Results 1 to 12 of 12

Thread: Need $category_name in detail_link

  1. #1
    Join Date
    Feb 2007
    Posts
    51

    Default Need $category_name in detail_link

    Is it possible to get the variable $category_name to show in the detail_link template? I can use it properly in the detail template.

    I only want to show the current category value and not the entire path as I get with $category_path. I'm using continents as level 1 and countries as level 2 and only want to show the current country name.

    Any ideas?

  2. #2
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    $category_name is available so it should work

    <%$category_name%> is how it's called.

  3. #3
    Join Date
    Feb 2007
    Posts
    51

    Default

    Bruceper, that was my initial idea as well, but nothing shows in detail_link when using <%$category_name%>. However, it shows in detail.

    I'm confused...

  4. #4
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    It doesn't work on Deluxe either, kinda weird.

    What if you added to detail.html just before detail_link.html is called.

    And in the meantime I'll see if I can find out why it doesn't work.

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

    Default

    It will work with detail.html, but not detail_link.html.
    Nakos is now working adding $category_name in detail_link.html, and it will also make this $category_name can be used in all kind of ....rows.html files.

  6. #6
    Join Date
    Nov 2007
    Posts
    227

    Default

    The line numbers I am referencing are may or may not be correct in your file.

    Line 778 in link.class.php is

    Code:
    $category_path_with_link_1stonly = $category_path_with_link;
    Directly below that insert this:

    Code:
    $category_name           = $category_obj->GetCategoryName($category_id);
    Now on line 1037 you will see this bach of code:

    Code:
            $tpl->assign('chk_box', $chk_box);
            $tpl->assign('category_path', $category_path);
            $tpl->assign('category_path_1stonly', $category_path_1stonly);
            $tpl->assign('category_path_with_link', $category_path_with_link);
            $tpl->assign('category_path_with_link_1stonly', $category_path_with_link_1stonly);
            $tpl->assign('disp_url', $disp_url);
            $tpl->assign('link_icon', $link_icon);
    Insert this directly below it:

    Code:
    $tpl->assign('category_name', $category_name);
    The category name is not passed to the detail_link file. This will pass it to the file. You then call it with <%$category_name%> as you did earlier.

    Regards
    Wayne
    For questions related to any mods I developed, please contact me by pm or email at webmaster [at] scriptdragon [dot] com

  7. #7
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    This might be an extremely dumb question, but hey... I have no pride, so I'll ask it anyways!

    Is there no way to make it so that any variable can be called from any .html file?!?!?
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  8. #8
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    To do that would mean moving all varialbes into one file, which honestly isn't a bad idea, but difficult to do since IndexU is a mature product.

    That's something that you would do for say Deluxe v2.0 which could be a total rewrite of the entire script (no i'm not saying we''re doing it, I'm saying that what COULD be done).

  9. #9
    Join Date
    Aug 2008
    Posts
    49

    Default

    for this case, we have been added codes to views category name fields. We define the category name fields as category_name, category_name1 and category_name2.

    so you only add this syntaxs (<%$category_name%>, <%$category_name1%> and <%$category_name2%>) on your template.

    you can download on svn (949)
    Last edited by nakos; 12-02-2008 at 10:39 PM.

  10. #10
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Of course this is for Deluxe, it could be adapted for 5.x but I haven't looked.

  11. #11
    Join Date
    Oct 2007
    Location
    UK Essex
    Posts
    591

    Default

    Is there any way we could have a function that printed the current category url.

    I know its of the subject
    ____________________________
    http://www.articleconveyer.com
    Give Your Articles Exposure



  12. #12
    Join Date
    Feb 2007
    Posts
    51

    Default

    Excellent mpdaddy. Your solution works fine for me. Thanks a lot. Rep given

Similar Threads

  1. Including within the detail_link.html file
    By echo@ in forum INDEXU DELUXE v1.x
    Replies: 8
    Last Post: 10-31-2008, 10:08 PM
  2. Inserting monoslideshow into detail_link?
    By CotswoldAdvisor in forum Blocks and Modification
    Replies: 5
    Last Post: 02-29-2008, 04:14 AM
  3. Premium detail_link.html
    By Baz@rr in forum v5.x
    Replies: 4
    Last Post: 05-04-2006, 03:56 AM
  4. Replies: 1
    Last Post: 06-03-2004, 08:03 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
  •