Results 1 to 5 of 5

Thread: Template Feature Request for 5.x

  1. #1
    Join Date
    May 2006
    Posts
    26

    Default Template Feature Request for 5.x

    Admin CP -> Categories: View/Edit/Delete -> Edit Category (Any Category)

    Scroll down to the Header Field ->

    ----------------------------------------------------------------
    Header
    Enter you html code for header of this category's page. If you leave it empty INDEXU will use cat_header.html
    ----------------------------------------------------------------
    It actually uses header.html but that is not the point of this post.

    I posted the above in the bugs area but it is relevant here. I could not find a forums for "IndexU Feature Rquests" so I am posting it here.

    While I was checking out this option I figured that there was a typo there and and figured I would try something. I copied the theme header.html to cat_header.html then modified the cat_header.html I just created so I could tell if it was being displayed. Then I rebuilt the cats and tested the category which I modified. It did not work.

    Also I tried using the template code options <%include file="cat_header.html"%> - This does not work either and I figured this option is not reading the template variables so I tried copying the contents of header.html with some changes so I can see the difference into the header field, rebuilt the cats again as always, but that does not work either. All the template variables do not work using the header field. So to me this header field is a useless option in my option. If you can not use the template variables here what good is it.

    Then it came to me. What about a category auto-detect template feature. ie: You have a Category called "Car Wallpaper" and in the themes directory you create a file called header.car_wallpaper.html or footer.car_wallpaper.html and when a visitor goes to that directory IndexU will find the file. There are of course performance issues with this but they are easliy overcome using a /custom_tempates or /custom directory under the theme directory you are using and will only read this directory if it is flaged under the admin options for that category. And of course there is the template cache that is already in use to help this as well. :-)

    This will allow a user to use includes as well as the other template variables.

    Anyone want to comment on this idea?

  2. #2
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    ----------------------------------------------------------------
    Header
    Enter you html code for header of this category's page. If you leave it empty INDEXU will use cat_header.html
    ----------------------------------------------------------------
    It actually uses header.html but that is not the point of this post.
    I'm sorry it's a typo. cat_header.html is removed since v5 and we only have one header file. This is not a bug, but we forgot to change the explaination above.

    Then it came to me. What about a category auto-detect template feature. ie: You have a Category called "Car Wallpaper" and in the themes directory you create a file called header.car_wallpaper.html or footer.car_wallpaper.html and when a visitor goes to that directory IndexU will find the file.
    Nice. But it's actually the same as we have for current header/footer html code for category in admin panel. Except, we store in database while you suggest to put it in template files.

  3. #3
    Join Date
    May 2006
    Posts
    26

    Default

    Quote Originally Posted by dody
    Nice. But it's actually the same as we have for current header/footer html code for category in admin panel. Except, we store in database while you suggest to put it in template files.
    Actually it is not. Your category header field option does not read template variables. I eplained that in my post which is why I suggested the auto detect template option. This would allow variables in those created templates. As your system stands now you can do nothing but add html in that header field. I suppose if I get creative I can use a conditional statment to include my own variables to change the header for specific categories... hmm now that I think about that I will test it out and post the results here to allow others to benefit from it.

    However this still leaves no ablity to add in the header field an include file or php option. Maybe there could be an alternate option field about the header one for a file name?
    Last edited by GremlinGod; 08-12-2006 at 05:14 PM.

  4. #4
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    Actually it is not. Your category header field option does not read template variables
    Good point, sorry i forgot that one.

    However this still leaves no ablity to add in the header field an include file or php option. Maybe there could be an alternate option field about the header one for a file name?
    However there's a trick to do the same job. In browse.html, do if.. then .. else ... compare with the category id
    Code:
    <%if $cat=10%>
      <%include file="header_software.html"%>
    <%elseif $cat=12%>
      <%include file="header_icon.html"%>
    <%elseif $cat=14%>
      <%include file="header_games.html"%>
    <%elseif $cat=15%>
      <%include file="header_wallpaper.html"%>
    <%else%>
      <%include file="header.html"%>
    <%/if%>
    Of course you should know the correct category id

  5. #5
    Join Date
    May 2006
    Posts
    26

    Default

    Thank you... I give that a whirl and see what comes of it. :-)

Similar Threads

  1. 'Feature' Request: Complete Language files
    By Regenerate in forum v5.x
    Replies: 10
    Last Post: 07-21-2006, 08:26 PM
  2. Replies: 0
    Last Post: 02-22-2005, 06:01 AM
  3. Replies: 7
    Last Post: 04-28-2004, 08:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •