Hi,
I was wondering if the value of the title field of a catalog item can be set as <title> of the detail page. Thanks for any help!
Daniel
Hi,
I was wondering if the value of the title field of a catalog item can be set as <title> of the detail page. Thanks for any help!
Daniel
Already available in the catalog Template variable array.
Hy thyon,
And how can I replace $this->pageTitle in fe_page by this value? Sorry, that's perhaps a stupid question.
Daniel
Ah I misunderstood, in the reader the title is automatically replaced by the title field selected for the catalog, when you edit the catalog (not edit fields)
Now I found the title field selection. It is only available after making the catalog searchable.
Thanks for your prompt help!
Daniel
I've made them independant in the alpha 2.0 version.
Hi Thyon,
I also use the catalog extension and it works great, also with multiple languages. But there is one thing that I wonder how to get this:
How can use the items title for the page title correctly? At the moment I do get the german items title as page title due to the restriction that I use one single catalog and can only determine one field to be used as title. So I have to choose the german one and the english one cannot be selected.
Is there a way to get this?
Regards,
Christian
Nope. the selection of the pageTitle is set as a HARD-coded field (one selection). Please submit a feature request for this, and we'll take a look at how to incorporate it.
Hi Tython,
just wanted to check on the status of this update.
I think having the ability to apply more than one field to the 'Page title field' would be very useful (maybe in the same way one can create the 'Format title string' one the same page?).
Additionally the catalog list would be extremely useful (especially for SEO) if when a filter was applied to a catalog list the title would change based on the filter.
I'm using catalog list a lot and Google Webmaster tools always complains about the duplicate title tags for different list filters which I link to in the main menu (for example in a where to buy list of distributors filtered by country)
see : http://www.brainboxes.com/where-to-buy/ ... country/GB
and: http://www.brainboxes.com/where-to-buy/ ... country/IN
for example of what I mean.
I think the catalog extension is awesome. thanks for all the hard work.
If possible and you need I will try to make a patch which will allow this, although I'm not too familiar with the inner workings of typolight and catalog extension
I'm not actively developing the catalog anymore, you'll have to ask one of the developers like xtra.
I'm starting something new, which will work in a completely different way, and therefore completely incompatible with the catalog -- which had numerous problems in its design, hence it's not possible to extend it effectively without a lot of extra work.
The title is settable PER catalog, which means the title field is used to update the reader page title, this can be a different title field, per catalog (Video Catalog can use Title, Downloads Catalog can use filename, etc.).
You can also manually update the title by doing this in your template:
It should work at Template level, since the template is only parsed at the very last step.Code:<?php global $objPage; $objPage->title = 'Whatever title I like'; .... template code ?>
This means you can also set-up the pageTitle to incorporate any of the Filter commands, e.g.
You'll have to do some processing on the filters to get to the $filters variable I used.Code:global $objPage; $objPage->title .= ' - filtered by '. $filters;
Ooooh -- that's very intriguing, Thyon. Could this be the holy grail "module creator" extension? :DOriginally Posted by thyon
Brian
Almost. I'll give you some more details....
[attachment=0:3nzu4hgk]large-tree.png[/attachment:3nzu4hgk]
Tree is the BackEnd Module, it includes: Tree Archives (catalogs), Trees (elements), Branch (display collections), Leaf (list,filter,link,trim,range,dates,sort,search elements).
There will be a few startup modules to display the contents of a Branch, which can then contain any combination of the leaf elements. So when you've setup the modules, you never have to edit them again. You just go the the BE Branch for the Tree and publish/unpublish the leaf elements to show/hide, or simply drag them up/down to reorder their appearance.
The structure will be completely modifying by any additional extension. The idea is that people can then product a Property, Store, Gallery, whatever Pack and then add that to the tree, with pre-set palettes, branches, etc.
Fantastic, Thanks for the help here really appreciate it, just what I needed.
good luck with your new project will try to follow it closely!
To be honest the fix wasn't quite as easy as you said, but you gave me all the right pointers to make it work. (slightly hacky though!)
Just in case anyone else tries to do this.
1. Add the following line to your catalog template:
<-- this doesnt yet fix anything as it seems like the pageTitle has already been written at this pointCode:<?php global $objPage; $objPage->title = "Some new Value you choose"; ?>
2. Create a PHP file which will post process pages to amend the page title:
3. Upload the file to /your/path/system/librariesCode:<?php class CustomHooks { public function fixPageTitle($strText, $strTemplate){ global $objPage; if( $strTemplate != "fe_page") { return $strText; } return str_replace('####pageTitle####', $objPage->title, $strText); } } ?>
4. Register hook by adding an output hook to /system/config/localconfig.php
5. Now you can edit any other template and use the (arbitarily choosen) string ####pageTitle#### . For example in the template file: fe_page.tplCode:$GLOBALS['TL_HOOKS']['outputFrontendTemplate'][] = array('CustomHooks', 'fixPageTitle');
This string will get replaced by the new title by the time its output to the user. Otherwise the page will retain its original title.
Hope this helps someone, i'm sure theres a cleaner way to do it, just not yet familiar enough with typolight
Maybe this will help someone too, if you want to figure out which filters have been selected by the user simply add this to the top of your filter template, (e.g. filter_default.tpl)
Code:<?php $selectedFilters = ""; foreach($this->widgets["filter"] as $widget){ $options = deserialize($widget["options"]); for ( $i = 1; $i < count($options); $i ++) { $option = $options[$i]; if(array_key_exists("selected", $option)){ $selectedFilters .= " > ". $widget["label"].": ".$option["label"]; break; } } } //assign the selected filters to the pageTitle //(warning this has no effect unless you use something similar to the hack i showed in the previous post global $objPage; $objPage->title .= $selectedFilters; ?>
Nope. my code works, but what you're forgetting is that the catalog template might not be the only thing that wants access to the title. Also my code is really only for the FILTER and LIST templates, since its not required at READER level, as that is already integrated into the catalog.
Its also only advisable to add it to the FILTER template, because the list template will be called multiple times, and it will keep overwriting itself.
Bookmarks