[SOLVED] Custom Page Option Fields?
[SOLVED] Custom Page Option Fields?
Is it possible to add Page options that the Content editors can set when creating their new pages?
There will be several 'content editors' and I want them to be able to select an option that will place their preconfigured photo/name on the page.
This image location is displayed in the template and not as part of the editable page content.
I previously used numerous templates with alternative CSS attached, but on this occasion, the combinations of templates/content editors will be numerous/confusing.
I believe that I will need a UDT to read the 'page option' and display the relevant image.
it might be possible to add a smarty tag in each content area and read that in the template, however, this will require some ability of the content editors to actually do it and do it correctly. I would prefer the custom page option.. option.
I found some similar requests, but no subsequent posts/solutions. Does anybody have any suggestions?
Thanks
There will be several 'content editors' and I want them to be able to select an option that will place their preconfigured photo/name on the page.
This image location is displayed in the template and not as part of the editable page content.
I previously used numerous templates with alternative CSS attached, but on this occasion, the combinations of templates/content editors will be numerous/confusing.
I believe that I will need a UDT to read the 'page option' and display the relevant image.
it might be possible to add a smarty tag in each content area and read that in the template, however, this will require some ability of the content editors to actually do it and do it correctly. I would prefer the custom page option.. option.
I found some similar requests, but no subsequent posts/solutions. Does anybody have any suggestions?
Thanks
Last edited by zark on Wed Jun 25, 2008 10:00 am, edited 1 time in total.
Re: Custom Page Option Fields?
You can use the tag {last_modified_by}. You have only to insert something like this
The tag outputs the username of the last editor. If there's a username.jpg for every editor available, it will display the editor picture ... that's all.
(... stands for the other img tag options
)
Code: Select all
<img src="uploads/images/editors/{last_modified_by format='username'}.jpg" ... />
(... stands for the other img tag options

Re: Custom Page Option Fields?
Good Thinking.. I don't think it will be viable in this situation though.
The image to be displayed is for the department manager (site section owner), they may have a couple of people editing their sections though, so I wouldn't want the 'sub editors' to have their images there. If I edit/fix up some pages on their behalf, this would also try to change the image.
I guess the only way this would be viable is if I created a log in based on pages to be edited, rather than by user and anyone who edited pages, would need to know what credentials to use for each page..
The image to be displayed is for the department manager (site section owner), they may have a couple of people editing their sections though, so I wouldn't want the 'sub editors' to have their images there. If I edit/fix up some pages on their behalf, this would also try to change the image.
I guess the only way this would be viable is if I created a log in based on pages to be edited, rather than by user and anyone who edited pages, would need to know what credentials to use for each page..

Re: Custom Page Option Fields?
If the department manager owns a ful section and his picture should be everytime displayed I suggest to use a special template with his picture inside.zark wrote: The image to be displayed is for the department manager (site section owner)
Re: Custom Page Option Fields?
Thanks cyberman.. I may end up doing that..
I have 4 distinct themed sections (Set up with different templates) and a dozen photo requirements, not to mention a default, no photo template, multiplied by the the 4 themed sections, that is a lot of templates for them to select between..
It seems a bit of a brute force soltion..
I was hoping to achieve something bit smarter like, 4 templates setup and a photo based on whatever was the selected option in the page options.
I think I might try educating them to include a smarty tag in the content and a write a UDT in the template to pick up the setting...
I have 4 distinct themed sections (Set up with different templates) and a dozen photo requirements, not to mention a default, no photo template, multiplied by the the 4 themed sections, that is a lot of templates for them to select between..
It seems a bit of a brute force soltion..
I was hoping to achieve something bit smarter like, 4 templates setup and a photo based on whatever was the selected option in the page options.
I think I might try educating them to include a smarty tag in the content and a write a UDT in the template to pick up the setting...
Re: Custom Page Option Fields?
There are many other options too 
You can use a second content block like
and use it with
in template.
On page creation you will see now a one line row without WYSIWYG. If you insert there CEO CEO.jpg will display. So the entry is undepending from owner or editor.

You can use a second content block like
Code: Select all
{content block='editor' oneline='true' wysiwyg='false'}
Code: Select all
<img src="uploads/images/editors/{content block='editor' oneline='true' wysiwyg='false'}.jpg" ... />
On page creation you will see now a one line row without WYSIWYG. If you insert there CEO CEO.jpg will display. So the entry is undepending from owner or editor.
Re: Custom Page Option Fields?

Thanks cyperman, that is perfect, much more gooderer..
So I just need to wrap this tag in a DIV and set the visibility to none in CSS.{content block='editor' oneline='true' wysiwyg='false'}
Thanks muchly.
Solution for anyone else..
Entered at top of body in template: (The value to this is set on the page content editor)
Code: Select all
<div id="contentowner">
{content block='editor' oneline='true' wysiwyg='false'}
</div>
Code: Select all
{capture assign='ownername'}{content block='editor' oneline='true' wysiwyg='false'}{/capture}
{ownerpicture name=$ownername}
Code: Select all
if ($params['name'] !=''){
echo "<div id="owner" style="background-image: url(images/path/img_".strtolower($params['name']).".jpg);"></div>";
}
Code: Select all
#contentowner{
display:none;
}
#owner img{
border: 1px solid #296aa9;
}
Last edited by zark on Wed Jun 25, 2008 10:38 am, edited 1 time in total.
Re: [SOLVED] Custom Page Option Fields?
You make it more difficult than it needs - the one and only is the following in template
Nothing to capture, nothing to hide - it's Smarty
.
Code: Select all
{content block='contentowner' oneline='true' wysiwyg='false' assign='ownerpicture'}
{if $ownerpicture neq ''}
<div id="owner" style="background-image: url(images/path/img_{$ownerpicture|lower}.jpg)"></div>
{/if}

Re: [SOLVED] Custom Page Option Fields?
cyberman wrote: You make it more difficult than it needs - the one and only is the following in template
Nothing to capture, nothing to hide - it's SmartyCode: Select all
{content block='contentowner' oneline='true' wysiwyg='false' assign='ownerpicture'} {if $ownerpicture neq ''} <div id="owner" style="background-image: url(images/path/img_{$ownerpicture|lower}.jpg)"></div> {/if}
.
