473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How can I index (SEO) a shortened HREF link?

Here is my predicament. I have a website the display the title of an event. Each event title is cut after a certain amount of characters and an ellipsis (...) is displayed. Google sees these links as "Vermont Maple..." and "Wine Blind Tas..." instead of "Vermont Maple Festival" and "Tastings at the Trapp Family Lodge Wine Cellar", respectively. Does anyone have any suggestions so that I can fit the event title in the calendar while also inserting the correct title into search indexes? I would like to keep the calendar the same size. Here is my code:

Shorten the title if it less than 14 characters:
Expand|Select|Wrap|Line Numbers
  1. if (strlen($eventdata[$day]["title"][$j]) > 14) {
  2. $permtitle = trim(substr($eventdata[$day]["title"][$j],0,14)) . '...';
  3. } else{
  4. $permtitle = trim($eventdata[$day]["title"][$j]);
  5. }
Display the linked title:
Expand|Select|Wrap|Line Numbers
  1. $str .= "
  2. <h2><span class=\"title_txt\">
  3. ‣<a href=\"eventdisplay.php?id=" . $eventdata[$day]["id"][$j] . "\" onclick=\"javascript:openPosting(" . $eventdata[$day]["id"][$j] . "); return false;\">" . $permtitle . "</a></span></h2><br>";
Apr 30 '11 #1
2 1874
JKing
1,206 Expert 1GB
Anchor tags have a "title" attribute that you could place the unshortened title into. It may or may not help with the SEO but it would improve accessibility at the very least.
May 1 '11 #2
Thank you, Jking. I have read that the title attribute doesn't help with SEO, but I will take your comment into consideration.
May 1 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Mark Pacey | last post by:
Hi, I have a web page that gets info from a mySQL database for various items, and slaps that info, along with pics onto the page. ( in a shopping site stylee) The pics have an href link, and I...
14
by: Brandon Hoppe | last post by:
I'm trying to change the src of an ilayer in the parent document from a link inside the ilayer. I'm not able to get it to work. All that happens is Netscape 4 crashes. This is for Netscape 4 only....
5
by: Per Johansson | last post by:
Is it possible to use XSLT to automatically create href links while it formats an XML document? That is, if it finds "http://me.us/" in a text, it adds <a href="http://me.us/">http://me.us/</a> --...
5
by: Mały Piotruœ | last post by:
Hello, (Sorry for my english.) I am new to HTML/JavaScript/CSS. I would like to ask for help with such a problem: I need to create a href link working like "back" button (I know this is not...
3
by: serge calderara | last post by:
Dear all, I have an application which display database result querry , store it in a dataset and bind a Datagrid control to it. I would like that the content of one particular column behaves...
1
by: serge calderara | last post by:
Dear all, I have a wrb application wich reads data from an SQL database and store them in a dataset. The dataset is then attached to a datagrid object I need to have a functionnality that when...
1
by: Mały Piotruœ | last post by:
Hello, (I am sorry for my English, it is not my native language.) I am new to JavaScript. Could you help me please with the following problem?: I need to make a href link on HTML page that leads...
10
by: pt36 | last post by:
Hi I have a page with a form and a textbox. before to submit the form I want to chek if the inserted value in the textbox is already present in a database. So I need to pass the textbox value...
18
by: requeth | last post by:
I'm trying to do the following, but when I have the code in for hte HREF link I get a runtime error. How do I pass the link to the end user? <% Dim a as string Dim b as string a =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.