Forums / General / Manageable content for content/search page

Manageable content for content/search page

Author Message

James Robertson

Thursday 08 September 2005 9:02:07 pm

How do I make the content/search page editable (ie. content manageable)?

For example; I want my content manager [person] to be able to change the 'Search Tips' text, without a developer having to modify (hard-coded) text in the content/search.tpl template.

Ɓukasz Serwatka

Thursday 08 September 2005 11:14:38 pm

You can create new content class with attribute "Search tips". Crete somewhere in content structure tree object from that class, and fetch it in content/search.tpl. Than your editor can change "Search tips" by editing object (using on-line editor if available), without interference in to template.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

James Robertson

Sunday 11 September 2005 2:16:31 pm

Hi Lukasz

This doesn't seem to work on any of our (3.4.2) eZ publish sites. I what versions should this feature work?

Arran Price

Sunday 11 September 2005 7:14:51 pm

Hi James,
The way Lukasz is mentioning I believe should work in any ezpublish implementation. Its just fetching the attribute from an object and displaying that attribute in the search form.

I normally do things like what you are asking in a similar manner (and is possibly less clean than Lukasz suggestion), but I dont normally create a custom class. Typically I will:
Override a folder to display the page, such as the search form. I will however put text like your "search tips" in the description field of the folder. Then in my new template (the custom search.tpl) I can fetch the folder and display the description field in the template.
That way, the editor can change the text without any updates being required of the templates.

Hope thats of some help.

Arran

James Robertson

Sunday 18 September 2005 5:21:59 pm

Thanks for the help Arran and Luke. This is basically what I though.

I was hoping for a tidier way. ie. to be able to create a node with a URL alias of content/search.

[BTW my second post regarding versions of eZ publish was a mistake, sorry. I thought I was replying to http://ez.no/community/bugs/remove_draft_objects_created_by_deleted_users. Too many tabs open in Firefox ;-]