PhpLD default URL Title

Discussion in 'Directories' started by Aragorn, Mar 27, 2007.

  1. #1
    I would like to change the default url title format ie the capitalizatin of the url and want to replace the underscores with hyphen. ie
    Arts_Culture => arts-culture
    Web_Directory => web-directory
    Can anyone please tell me how to do it?
    Thanks :)
     
    Aragorn, Mar 27, 2007 IP
  2. donttrustthisposter

    donttrustthisposter Peon

    Messages:
    1,477
    Likes Received:
    91
    Best Answers:
    0
    Trophy Points:
    0
    #2
    When you create a category you choose the exact URL:confused:

    What the heck are you talking about?
     
    donttrustthisposter, Mar 27, 2007 IP
  3. an0n

    an0n Prominent Member

    Messages:
    5,688
    Likes Received:
    915
    Best Answers:
    0
    Trophy Points:
    360
    #3
    There are actually two ways you can accomplish this.

    1. via the database run this: UPDATE `PLD_CATEGORY` SET `TITLE_URL`=replace(`TITLE_URL`,'_','-');

    2. within the main.tpl: {$cat.TITLE|replace:'_':'-'}

    either or will suffice :)
     
    an0n, Mar 27, 2007 IP
    Aragorn likes this.
  4. Aragorn

    Aragorn Peon

    Messages:
    1,491
    Likes Received:
    72
    Best Answers:
    1
    Trophy Points:
    0
    #4
    I'm sorry, I forgot to add that I'm using the Quick Subcategory Adder mod. If I'm to manually edit each URL's it is going to take me atleast a month to complete it.
     
    Aragorn, Mar 27, 2007 IP
  5. Aragorn

    Aragorn Peon

    Messages:
    1,491
    Likes Received:
    72
    Best Answers:
    1
    Trophy Points:
    0
    #5
    Thanks a lot an0n. :) In the second method can you please tell me how to make the URL Title lowercase?
     
    Aragorn, Mar 27, 2007 IP
  6. an0n

    an0n Prominent Member

    Messages:
    5,688
    Likes Received:
    915
    Best Answers:
    0
    Trophy Points:
    360
    #6
    {$cat.TITLE|replace:'_':'-'|lower}

    do the same this for the subcats too, ok?

    {$scat.TITLE|replace:'_':'-'|lower}


    :D
     
    an0n, Mar 27, 2007 IP
  7. Aragorn

    Aragorn Peon

    Messages:
    1,491
    Likes Received:
    72
    Best Answers:
    1
    Trophy Points:
    0
    #7
    Thanks again an0n. On a second thought, in the second method won't the conversion be done every time the page is loaded? Isn't the first one a better solution?
     
    Aragorn, Mar 27, 2007 IP
  8. donttrustthisposter

    donttrustthisposter Peon

    Messages:
    1,477
    Likes Received:
    91
    Best Answers:
    0
    Trophy Points:
    0
    #8
    It might be more trouble than it's worth. Doesn't Google see capital letters as seperate URLS from lower case? Are you already indexed?

    Anons database update will be a one shot deal.
     
    donttrustthisposter, Mar 27, 2007 IP
    Aragorn likes this.
  9. Aragorn

    Aragorn Peon

    Messages:
    1,491
    Likes Received:
    72
    Best Answers:
    1
    Trophy Points:
    0
    #9
    I'm starting again from scratch. New cateogory names, descriptions, entries etc
     
    Aragorn, Mar 27, 2007 IP
  10. an0n

    an0n Prominent Member

    Messages:
    5,688
    Likes Received:
    915
    Best Answers:
    0
    Trophy Points:
    360
    #10
    as stated, the #1 is a one short directory update. #2 is an 'on the fly' smarty method. either or will work.
     
    an0n, Mar 27, 2007 IP
  11. Aragorn

    Aragorn Peon

    Messages:
    1,491
    Likes Received:
    72
    Best Answers:
    1
    Trophy Points:
    0
    #11
    It worked great :) I selected the MySQL solution as it is one time
     
    Aragorn, Mar 27, 2007 IP
  12. smub

    smub Notable Member

    Messages:
    3,443
    Likes Received:
    375
    Best Answers:
    0
    Trophy Points:
    230
    #12
    awesome codes .. i might use it too an0n ... thanks alot .. so we can remove the hyphen and underscore if we like ??
     
    smub, Mar 27, 2007 IP