Author Topic: Different media templates for different categories  (Read 6434 times)

0 Members and 1 Guest are viewing this topic.

Offline gustav

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Different media templates for different categories
« on: December 16, 2006, 01:32:01 PM »
can someone help me to make it possible to use different media templates for different categories.... similar to "MOD different cat templates" http://www.4homepages.de/forum/index.php?topic=1847.0
Also so that a media template gets inherited on subcategories.

So, that at the end same types of files will be displayed in different templates, depending on in what category they are in...

thanx....

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: Different media templates for different categories
« Reply #1 on: December 16, 2006, 01:57:19 PM »
Hi,

hmmmm :?:

You need different media.html or details.html
When you need different details view,

use :
details_1.html
details_2.htm
 for cat 1 or 2
==> look in the Nr.3 of your link in the top of this thread

Kurt

Offline gustav

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Different media templates for different categories
« Reply #2 on: December 16, 2006, 02:03:59 PM »
yeah... have this "different cat templates"-mod already built in.. but I need that for the media files like /media/jpg.html.....

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: Different media templates for different categories
« Reply #3 on: December 16, 2006, 02:14:21 PM »
what kind of differents do you like in jpg.html?
Is it not possible with different details.html?

Kurt

Offline gustav

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Different media templates for different categories
« Reply #4 on: December 16, 2006, 02:37:10 PM »
no..... as the media template gets included by the details.php.... so even if I change the details template, the media template still stays the same...... but I need to be able to assign different media templates.... If I could exchange the {image} tag with something like {image1}... that would then call a different media template from whithin the details.php... that would be cool already.... so maybe it could work by duplicating some code in the details.php... and renaming this function to image1.... !?

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: Different media templates for different categories
« Reply #5 on: December 16, 2006, 02:52:50 PM »

Offline gustav

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Different media templates for different categories
« Reply #6 on: December 16, 2006, 03:07:28 PM »
Hmmmm.... looks promising.. but I can't use the "define" function in that case in the details.php... else all media templates will switch... unless it is possible to switch it from within the details.html template!? then I could set the "postcard" switch to 1 in the details.html file, what would then call the new media template....
(I have no clue about PHP.. so please excuse all the questioning....)

Offline gustav

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Different media templates for different categories
« Reply #7 on: December 16, 2006, 03:21:43 PM »
ahhhh... guess I got it to work.... will try a bit more.... :).... Thanx!!! :)

edit..... no, not working..... included the following into details_1.html for testing...
Code: [Select]
<?php
define 
("mediatpl""1");
echo 
mediatpl;
?>

Echo returns the correct value....

then edited the line of code in the functions.php to call the new media template when the mediatpl flag is 1.....
But didn't work...
After putting another echo into the media template to show the mediatpl value it only returns the word mediatpl as echo.. so seems the flag does not reach the needed portion of code before it gets resetted again!?
« Last Edit: December 16, 2006, 03:36:32 PM by gustav »