eZ Community » Forums » General » How do I add an editable field to...
expandshrink

How do I add an editable field to pagelayout.tpl

How do I add an editable field to pagelayout.tpl

Wednesday 18 July 2012 3:05:42 pm - 2 replies

Hi,

Basically I'm after another editable field like "footer" that I can edit through the admin "Look and feel" editor

any help would be appreciated

Wednesday 18 July 2012 6:16:09 pm

Hi Neo, 

This shouldn't be too difficult. 

First, edit the 'Template Look' object class using the Class Editor in the admin ('Setup' Tab -> 'Classes' on the left -> 'Setup' Class Group, edit the 'Template Look' class). Add whatever new attributes you would like in here, and save. Take note of what you gave eZ for the 'identifier' of your attribute - you'll need it in a minute.

When you go back to edit the 'look and feel' under design, you should see your new field there. Go ahead and fill it in, and publish.

Second, now that you have new content to display, you need to place a tag in the template to tell eZ Publish where to display it. You need to edit the pagelayout.tpl in the design you're using (depending on your install, this may be in several locations - you can turn on 'template debug' in the admin to find the path for the file.

Add some code like the following where you want your content to display (in this example, I've called my attribute 'disclaimer' as the identifier:

 {attribute_view_gui attribute=$pagedesign.data_map.disclaimer}

The syntax of that will vary with how your site is built, but that should work from most reasonably modern eZ sites.

Hope that's helpful!

Friday 20 July 2012 10:47:38 pm

Thanks Joe

It was the first (most important part) I was having trouble locating happy.gif Emoticon

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu