Ticket #529 (closed enhancement: fixed)

Opened 7 years ago

Last modified 2 years ago

Add 'tag' parameter to PageTitle()

Reported by: DomBonj Owned by: DotMG
Priority: low Milestone: 1.3.3
Component: formatters Version: 1.1.6.3
Severity: minor Keywords:
Cc: BrianKoontz

Description

It would be useful for PageTitle() in Wakka.class.php to take an optional 'tag' parameter, in order to be able to access any page's title.

Change History

  Changed 7 years ago by BrianKoontz

The problem here is that it's an expensive operation, as the page title isn't created until *after* the page has been rendered. A less expensive option would be to create a new DB field called "title" and update the field after completing an edit (since the page is always rendered after an edit).

The alternative would be to search through the page markup text for the first header element smaller than an equivalent h5. This would also be an expensive operation (esp. for large pages).

I would propose to the group that creating a new DB field in wikka_pages called "title" would create little overhead on the DB side of things, and would be a useful addition.

follow-up: ↓ 4   Changed 7 years ago by BrianKoontz

(In [574]) --Added optional "tag" parameter to PageTitle --DB now stores page title after edits and clones --Modified PageIndex to display page titles --Refs #529

  Changed 7 years ago by BrianKoontz

  • status changed from new to closed
  • resolution set to fixed

in reply to: ↑ 2   Changed 7 years ago by JavaWoman

Replying to BrianKoontz:

(In [574]) --Modified PageIndex to display page titles

PageIndex with page titles is nice, but it should be an option !

  Changed 7 years ago by BrianKoontz

(In [580]) Added showpagetitle option to select/deselect display of page titles next to page links. Refs #529

  Changed 6 years ago by BrianKoontz

  • status changed from closed to reopened
  • resolution fixed deleted

Need to add 'title' column to installer switch statement; otherwise upgrade from stable->unstable fails with 'title' column not found error.

  Changed 6 years ago by DarTar

  • cc BrianKoontz added

Brian, it hadnt occurred to me that the title as stored in the DB can also be used on RecentChanges as an option or as a link title when we render links.

  Changed 6 years ago by BrianKoontz

  • status changed from reopened to closed
  • resolution set to worksforme

Works with fresh 1.1.6.2 install, must have been something local to my dev machine.

  Changed 6 years ago by DotMG

  • status changed from closed to reopened
  • resolution worksforme deleted

Update from stable -> instable fails if you install a fresh 1.1.6.5 and then upgrade to trunk. The reason is that the CREATE TABLE in 1.1.6.5 lacked a number of fields.

Upgrading from 1.1.6.3 or earlier to unstable is fine.

  Changed 6 years ago by DotMG

  • owner changed from unassigned to DotMG
  • status changed from reopened to assigned

  Changed 6 years ago by DotMG

  • status changed from assigned to accepted

follow-up: ↓ 13   Changed 6 years ago by DarTar

a few ideas:

  • we should add an index for the title column in the table if we are likely to do operations on this
  • we might provide an option to display the content of this field not just in PageIndex but in all page-related actions (including TextSearch, TextSearchExpanded, RecentChanges, OrphanedPages, MyPages etc.)
  • search forms could have an additional option to restrict search in tags and/or page titles only
  • we could use this field to generate titles for internal links, if this is not too computationally demanding

in reply to: ↑ 12 ; follow-up: ↓ 14   Changed 6 years ago by DotMG

Replying to DarTar:

a few ideas: * we should add an index for the title column in the table if we are likely to do operations on this * we might provide an option to display the content of this field not just in PageIndex but in all page-related actions (including TextSearch, TextSearchExpanded, RecentChanges, OrphanedPages, MyPages etc.) * search forms could have an additional option to restrict search in tags and/or page titles only * we could use this field to generate titles for internal links, if this is not too computationally demanding

  • An index is needed only if we are likely to do search operations on title column.
  • The content of the field title should not be displayed on RecentChanges. As a title="...." parameter, I agree, but not as any textNode. This to avoid confusion with edit note which should be the only text emphasized for RecentChanges.
  • Generating title attributes for links won't be computationally demanding. But maybe, we should replace existsPage() with a method which checks if page exists and gets at the same time the page title.

in reply to: ↑ 13   Changed 6 years ago by DarTar

Replying to DotMG:

* An index is needed only if we are likely to do search operations on title column.

precisely

* The content of the field title should not be displayed on RecentChanges. As a title="...." parameter, I agree, but not as any textNode. This to avoid confusion with edit note which should be the only text emphasized for RecentChanges.

The content of the title attribute depends IMO on what we are displaying. If the links refer to a revision (as in RecentChanges, /history, /revisions etc.) it might be useful to display the last edit note as s title (unless a more informative title is available). If the links refer to pages (as in PageIndex, MyPages, TextSearch) then we may display the title of the target page.

* Generating title attributes for links won't be computationally demanding. But maybe, we should replace existsPage() with a method which checks if page exists and gets at the same time the page title.

Agreed

  Changed 5 years ago by DarTar

  • milestone changed from 1.2 to 1.3

Retargeting to 1.3. Code for this ticket may have already been committed to trunk, from which 1.3 will be branched. Consider backporting urgent issues to 1.2.X

  Changed 4 years ago by BrianKoontz

  • milestone changed from 1.3 to blue-sky

  Changed 2 years ago by DotMG

  • milestone changed from blue-sky to 1.3.3

  Changed 2 years ago by DotMG

(In [1849]) Re-submitting [574] and [580] to trunk. refs #529 Taking care of the installer scripts.

Changelog:

  • New field title in the pages table
  • The installer upgrade (or fresh install) will perform a maintenance operation which consists of populating the value of the title field
  • PageIndex: now, by default, PageIndex will show the title of the page. To disable this (i.e. conserve the old behaviour, users should add parameter showpagetitle="0" when calling the action. IOW: {{pageindex showpagetitle="0"}}

  Changed 2 years ago by DotMG

  • status changed from accepted to testing

  Changed 2 years ago by BrianKoontz

  • status changed from testing to commit

  Changed 2 years ago by BrianKoontz

  • status changed from commit to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.