Results 1 to 7 of 7

Thread: different browse.html templates for different categories !?

  1. #1
    Join Date
    Nov 2002
    Posts
    15

    Default different browse.html templates for different categories !?

    hello

    i want use custom browse.html for some categories

    i try different way

    ex

    PHP Code:
    if ($cat=1)

            
    $bro_template "browse2.html";
    } else {  
            
    $bro_template "browse.html";
    }

      
    DisplayTemplate($theme_path.$bro_template,"\$category_path,\$category_path_search_opt,\$category,".
        
    "\$num_rows,\$pagination,\$cat,\$link,\$content,\$start_number,\$ma,\$editor,\$featured_link,\$hot_links,\$top_votes,\$new_links");

    ex2

    PHP Code:
    if($cat 1)          DisplayTemplate($theme_path."browse2.html","\$category_path,\$category_path_search_opt,\$category,".
        
    "\$num_rows,\$pagination,\$cat,\$link,\$content,\$start_number,\$ma,\$editor,\$featured_link,\$hot_links,\$top_votes,\$new_links");
     
        else
      
    DisplayTemplate($theme_path."browse.html","\$category_path,\$category_path_search_opt,\$category,".
        
    "\$num_rows,\$pagination,\$cat,\$link,\$content,\$start_number,\$ma,\$editor,\$featured_link,\$hot_links,\$top_votes,\$new_links");



    but with this codes it use browse2.html for all categories not Cat 1

    way i want to do this ??

    cuz i want custom browse.html for parent categories <<<

    any tips

    thx
    Last edited by fwebz; 03-31-2004 at 02:14 AM.

  2. #2
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    change

    Code:
    if ($cat=1)
    to

    Code:
    if ($cat == 1)
    and if I had a $1.00 for every time I did the same thing, we could both retire today to the beach and sip margaritas all day long!


    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  3. #3
    Join Date
    Nov 2002
    Posts
    15

    Default

    hello esm,thanks for your reply

    here is the final code

    PHP Code:
    if ($cat == 1

            
    $bro_template "browse2.html"
    } else {   
            
    $bro_template "browse.html"


      
    DisplayTemplate($theme_path.$bro_template,"\$category_path,\$category_path_search_opt,\$category,".
        
    "\$num_rows,\$pagination,\$cat,\$link,\$content,\$start_number,\$ma,\$editor,\$featured_link");

    but how i add more cat in

    if ($cat == 1)

    if ($cat == 1,2,3)

    like that ?

    Last edited by fwebz; 03-31-2004 at 10:28 PM.

  4. #4
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    the problem is probably with the Display Template function.

    Code:
    DisplayTemplate($theme_path."browse2.html"," \$category_path,\$category_path_search_opt,\$categ
    ory,". 
        " \$num_rows,\$pagination,\$cat,\$link,\$content,\$s
    tart_number,\$ma,\$editor,\$featured_link,\$hot_li
    nks,\$top_votes,\$new_links");
    and it is probably caused by vBulletin inserting a line break into the code. vB will only allow 50 characters in arow and then it will insert a line break.

    Notice the two lines above:

    Code:
    \$num_rows,\$pagination, \$cat,\$link,\$content,\$s
    and
    Code:
    tart_number,\$ma,\$editor, \$featured_link,\$hot_li
    they should look more like

    Code:
    \$num_rows, \$pagination, \$cat,\$link, \$content, \$start_number,
    and
    Code:
    tart_number, \$ma, \$editor, \$featured_link, \$hot_links,
    try this line instead

    Code:
    Code:
    DisplayTemplate($theme_path."browse2.html"," \$category_path, \$category_path_search_opt, \$category,".
    "\$num_rows,\$pagination,\$cat, \$link,\$content, \$start_number,\$ma, \$editor,\$featured_link, \$hot_links,\$top_votes,\$new_links");
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  5. #5
    Join Date
    Nov 2002
    Posts
    15

    Default

    yes yes

    i edit my post

    sorry

    here is the final code

    PHP Code:
    if ($cat == 1

            
    $bro_template "browse2.html"
    } else {   
            
    $bro_template "browse.html"


      
    DisplayTemplate($theme_path.$bro_template,"\$category_path,\$category_path_search_opt,\$category,".
        
    "\$num_rows,\$pagination,\$cat,\$link,\$content,\$start_number,\$ma,\$editor,\$featured_link");

    but how i add more cat in

    if ($cat == 1)

    if ($cat == 1,2,3)

    like that ?

    thank you agine esm
    Last edited by fwebz; 03-31-2004 at 10:33 PM.

  6. #6
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    Originally posted by fwebz

    but how i add more cat in

    if ($cat == 1)

    if ($cat == 1,2,3)

    like that ?
    Code:
    if ($cat==1 or $cat==2 or $cat==3) {
    or this way is suppose to work also
    Code:
    if ($cat==1 || $cat==2 || $cat==3) {
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  7. #7
    Join Date
    Nov 2002
    Posts
    15

    Default

    work gr8

    esm ur the man here

    thank you agine and agine

Similar Threads

  1. Show meta description in browse.html
    By binto in forum v5.x
    Replies: 3
    Last Post: 06-07-2004, 06:39 PM
  2. unlimited categories?
    By norri in forum Pre-Sales Questions
    Replies: 2
    Last Post: 04-06-2004, 06:35 PM
  3. How many categories do you have?
    By Hart_House in forum v5.x
    Replies: 1
    Last Post: 10-31-2003, 05:12 PM
  4. Searching specific sub categories
    By Rob Picken in forum v5.x
    Replies: 2
    Last Post: 02-11-2003, 06:01 AM
  5. Changing the format...templates
    By fattymen in forum v5.x
    Replies: 7
    Last Post: 11-06-2001, 05:39 PM

Posting Permissions

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