Support Forums

title tags on calling urls

This is a discussion on title tags on calling urls within the Technical Support forums, part of the Technical Support Forums category; Can anyone tell me how to remove the last character which is > from this call to a url (browselistings.tpl) ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 05-31-2008, 08:21 PM   #1
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,037
Rep Power: 49
seymourjames has a spectacular aura about
Default title tags on calling urls

Can anyone tell me how to remove the last character which is > from this call to a url (browselistings.tpl)

$data[td].start_link


For example what I really want to do is

take this <a href="blablabla"> which is $data[td].start_link and make this <a href="blablabla" title="xxxxx">. If this can be done then it is possible to have calls to the category pages called with title tags in place. This could have a nice SEO benefit for 68 classifieds users. If it could also be done for listings as well then a substantial SEO benefit is gained.


What I am really trying to achieve is a 'script' which carries around not only the urls but their title tags for categories and listings. Creating unique title tags for pages is possible but I can only presently assign them at the point of display and not at the point they are called.

I am probably talking jibberish. Perhaps there is a simple way to do this.
seymourjames is offline  
Old 06-01-2008, 06:25 AM   #2
Jon
Junior Member
 
Join Date: May 2008
Posts: 23
Rep Power: 7
Jon is on a distinguished road
Default

Hey

Use the replace smarty modifier:

Code:
$data[td].start_link|replace:'>':' title="xxxxx">'
I haven't tested this, but it seems logical
__________________
Version 4.0.9 Developer
Jon is offline  
Old 06-01-2008, 06:27 AM   #3
Jon
Junior Member
 
Join Date: May 2008
Posts: 23
Rep Power: 7
Jon is on a distinguished road
Default

Sorry, that assumes that you are wanting to perform this action within the tpl, if you're using php, try str_replace:

http://uk.php.net/manual/en/function.str-replace.php
__________________
Version 4.0.9 Developer
Jon is offline  
Old 06-01-2008, 07:26 AM   #4
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,037
Rep Power: 49
seymourjames has a spectacular aura about
Default

Thanks Jon,

Nearly works.

so no problem with this

{$data[td].start_link|replace:'>':' title="xxxxx" >'}<strong>{$data[td].name}</strong></a>

but I really want to do make is make the xxxxx = $data[td].name. Dynamically assigned. I tried this but it did not work.

{$data[td].start_link|replace:'>':' title="$data[td].name" >'}<strong>{$data[td].name}</strong></a>

I am no smarty expert. Any help to solve one of my last problems in SEO on my site would be gratefully appreciated.
seymourjames is offline  
Old 06-01-2008, 09:16 AM   #5
Jon
Junior Member
 
Join Date: May 2008
Posts: 23
Rep Power: 7
Jon is on a distinguished road
Default

You almost had it

Here is the correct syntax:

Code:
{$data[td].start_link|replace:'>':" title=\"$data[td].name\" >"}<strong>{$data[td].name}</strong></a>
In PHP/Smarty, data within single quotes is considered a literal and IS NOT interpolated (in this case $data[td].name is literally dumped to the screen), data within double quotes IS interpolated ($data[td].name is read and substituted for your value).
__________________
Version 4.0.9 Developer
Jon is offline  
Old 06-01-2008, 09:22 AM   #6
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,037
Rep Power: 49
seymourjames has a spectacular aura about
Default

Hi Jon,

When I use your suggested line of code I get title="Array.name" in the source. Strange. Any ideas why? I really want to solve this one. It has been bugging me for weeks.
seymourjames is offline  
Old 06-01-2008, 06:20 PM   #7
Jon
Junior Member
 
Join Date: May 2008
Posts: 23
Rep Power: 7
Jon is on a distinguished road
Default

Code:
{$data[td].start_link|replace:'>':" title=\"`$data[td].name`\">"}<strong>{$data[td].name}</strong></a>
Sorry for the misdirection - this should work with an array!
__________________
Version 4.0.9 Developer
Jon is offline  
Old 06-01-2008, 07:48 PM   #8
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,037
Rep Power: 49
seymourjames has a spectacular aura about
Default

You made my day. This is a really good seo mod to do so that title tags can be added in browse.tpl when calling the urls for categories. Or indeed anywhere these urls are called like on the standard home page. It is one thing to get each page to have a nice seo friendly url, nice title and meta tags but internal linking is still very important. Thanks again.
seymourjames is offline  
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting title tags with URLs (smarty) seymourjames Modules / Plugins / Modifications 0 04-24-2008 09:39 PM
How To Create A Dynamic Ad Title From Ad Fields? bgordon v3.1 Questions & Support 5 04-16-2007 07:33 PM
Problem getting page title flyingpylon v3.1 Questions & Support 5 10-19-2006 02:15 PM
Adding a (sub)category picture and title jamesbond v3.1 Questions & Support 4 08-11-2006 08:45 AM


All times are GMT -4. The time now is 10:23 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0