Forums / Setup & design / creating view_mode_gui
Alexander Celle
Wednesday 16 July 2003 5:00:54 pm
Hi, I've been trying for several days to create new view modes and have not been able to do so.
I read somewhere in this site that it was as easy as creating a template in /override/content/node/view/newmode.tpl and then call it with mode=newmode.
I did that but it won't work. I even created the template in /standard/content/node/view/ and nothing happened.
Any ideas of what's wrong?m (my version is 3.1.1) Thanks,Alex
Claire Lin
Wednesday 16 July 2003 5:53:15 pm
Have you cleared all cache manually? WHen things do not work as expected I go to the cache directory and delete everything manually.
If cache is not an issue, the following is how I created my own view modes with "extension": 1. create the following directories under Exponential folder /extension/YOUREXTENSION/design/standard/templates/node/view (replace YOUREXTENSION with whatever you want to call your extension)
2. Let Exponential knows about your newly created extension by adding the following line to setting/override/site.ini.append.php: (create the directories and the file site.ini.append.php if they do not exist) [ExtensionSettings]ActiveExtensions[]=STEExtension
3. Let Exponential knows to look for extra template files under the design folder of YOUREXTENSION, add the following to /extension/YOUREXTENSION/settings/design.ini.append (create the directories and the file design.ini.append if they do not exist) [ExtensionSettings]DesignExtensions[]=STEExtension
4. Create any template file for your view mode. Say you want to use a mode called "simple". Create simple.tpl and put it in the directory you created in step 1(/extension/YOUREXTENSION/design/standard/templates/node/view). 5. Now you should be able to view any content node (for example node 123) by typing this url: .../content/view/simple/123
I hope that I didn't miss any steps. Good luck.
Wednesday 16 July 2003 9:44:57 pm
I followed your steps carefully and worked perfectly. I also found a couple of "official" pages with the help you gave me (btw, this extension system looks great!!)
The page is:http://www.ez.no/developer/ez_publish_3/documentation/development/extensions/introduction_to_extensions
Although it does not mention the need for the design.ini file
Thanks for the help
Vicente Olivan
Friday 31 March 2006 9:16:39 am
Help, one question
Is necessary to create one extension for additional viewmodes templates?
Example
/design/base/override/templates/full/article.tpl /design/base/override/templates/line/article.tpl /design/base/override/templates/other_1/article.tpl/design/base/override/templates/other_2/article.tpl
some other form to do it
Vasilii Pascal
Thursday 14 December 2006 4:29:39 am
Hi , thanks for your steps they help me too ,but to display only html :) . How can i fetch any data from sometable and assign them to /node/view/sometemplate.tplOr what script or class is responding for this operation ,or how can i make my extention class be automatic executed by EZ on user site access .
sometemplate.tpl
{foreach $List_Arr as $rec} {$rec.id}{$rec.name} {/foreach}
thanks !