[support] Node Template Variant

Linda Romey lromey at gmail.com
Mon Sep 30 19:14:31 UTC 2013


As far as I understand if yo uwant to override templates by content type
you must have a template file for each type.

In panels you can create a custom page and then create a page template file
for the url of your custom page. This takes care of the PAGE display. Then,
to get your individual nodes to display in this page, use a url pattern
that sets the default page for all the content types you want displayed
through this page as the first argument:
myhomepage.org/page-name/this-node --- with page-name being the custom
page.

If you want the content types to be displayed differently you can still
create node template variants for them. As long as the url string begins
with the page name each of teh node variants will be rendered through the
custom page.

good luck!



On Mon, Sep 30, 2013 at 12:12 PM, Chris Miller <cjm at tryx.org> wrote:

> *From: *"LINDA ROMEY" <lromey at gmail.com>
> *To: *support at drupal.org
> *Sent: *Friday, September 27, 2013 3:52:05 PM
> *Subject: *Re: [support] Node Template Variant
>
> Chris, just as you put all contrib modules in sites/all/modules, you
> should have your themes in sites/all/themes
> so you'd have sites/all/themes/yourtheme
> and in yourtheme you'd have a direcotry called templates. Most themes have
> one, if not, create one. Any template you create or any template you alter
> (i.e. a template supplied by a module) should go in that folder. Then you
> don't have to worry about overriding with upgrades
>
>
> Hi Linda,
>
> So, I am using the Bartik theme, for now, and I seek special formatting
> for a content-type called "Music".  If I understand your instructions, then
> I should copy and subsequently modify:
>
>    - /themes/bartik/templates/node.tpl.php ==>
>    /sites/all/themes/bartik/templates/node--music.tpl.php
>    - /themes/bartik/templates/page.tpl.php ==>
>    /sites/all/themes/bartik/templates/page--node--music.tpl.php
>
> So far, so good?
>
> Now my next question.  Let's assume that this is going to happen more
> frequently than just this one content-type.  Is there a way to make the
> template general and applicable to arbitrary content, like assign it to a
> panel, and then I can put whatever content I need on that panel?  I don't
> know if I will need this template again, but my preference is to create a
> re-usable template, not a special kind of content-type.  Can that be done?
>
> Thanks for the help,
>
> Chris.
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20130930/cb997265/attachment.html 


More information about the support mailing list