Hello David
I am trying to create sitelinks / list pages from the sitemap.php
I created/renamed the sitemmap.php to sitelinks.php and mixed up the code a little bit to get a list with links.
Now i want to use the merchant and product name as a link, and not the whole url. Is that possible?
(Example page: https://www.example.com/sitelinks.php)
(Example page: https://www.example.com/sitelinks.php?filename=Cookinglife.csv)
This is how i have it now
https://www.example.com/sitelinks.php?filename=Cookinglife.csv
https://www.example.com/products.php?q=Voorraadpot+bamboe+wit+900+ml
This is what i want (without url, only the name, and if possible without +)
And i just cant get it fixed, and cant get the changes made to the ($sitemapBaseHREF.$sitemapHREF.) to stip the urls.
i hope you understand what i mean ;-)
Greetings Arlo
Hello David,
- when i place the new code on top in my file nothing changes.
- When i place the code into the code (url and print) where i need the encoded url.. i get: Internal Server Error
Where do i place the code?
<?php
$link = $sitemapBaseHREF.$sitemapHREF;
$parts = explode("=",$link);
print "<a href='".$link."'>".urldecode($parts[1])."</a>";
?>
{link saved} for example where i need to place the code.
I hope you can fix it
Greetings Arlo
Hello Arlo,
Where you have this line in your code (2 instances);
print "<a href='".$sitemapBaseHREF.$sitemapHREF."'>".$sitemapBaseHREF.$sitemapHREF."</a>";
...have a go with:
$link = $sitemapBaseHREF.$sitemapHREF;
$parts = explode("=",$link);
print "<a href='".$link."'>".urldecode($parts[1])."</a>";
Cheers,
David.
--
PriceTapestry.com
Hello David,
Hi David, I tried it and it partly works. But with the product links, no list is made and you only see 1 product.
{link saved}
Greetings Arlo
Hello Arlo,
You could explode() the link on the "=" character and use the second value in the array with urldecode() to remove the "+" characters (SPACE in a URL) for example:
<?php
$link = $sitemapBaseHREF.$sitemapHREF;
$parts = explode("=",$link);
print "<a href='".$link."'>".urldecode($parts[1])."</a>";
?>
Hope this helps!
Cheers,
David.
--
PriceTapestry.com