using page description for internal links
Permalink Browser Info Environment
Hi Guys,
is it possible to use using page description for internal links, not the link itself?
Regards
Torsten
is it possible to use using page description for internal links, not the link itself?
Regards
Torsten
Type: | Discussion |
---|---|
Status: | New |
Hey Jordan - so much stuff and just one guy behind? Wow! ;-)
thanks for the fast and working reply but I think I asked wrong (but I'm sure I need that as well next time^^).
I need the pretty URLs (like "Hello World"), not the long ones (like "http://www.xyz/blog/hello-world").
Thanks
Torsten
thanks for the fast and working reply but I think I asked wrong (but I'm sure I need that as well next time^^).
I need the pretty URLs (like "Hello World"), not the long ones (like "http://www.xyz/blog/hello-world").
Thanks
Torsten
I'm sorry, but I do not understand what you are asking. Can you take a screenshot of how your block is now, then explain how exactly you want it to be different?
-Jordan
-Jordan
Hey Jordan
the Block shows the whole URL of the internal Link (the whole path/ Canonical URL). I just need the Name of the Page displayed. Do you understand or need a screenshot?
Regards
Torsten
the Block shows the whole URL of the internal Link (the whole path/ Canonical URL). I just need the Name of the Page displayed. Do you understand or need a screenshot?
Regards
Torsten
The code I posted above should be showing the description of the page (which is what you asked for in your first question), but perhaps your descriptions are empty so it's showing the URL instead?
But it sounds like what you really want is the page name, not the description. So try this code instead:
If that still doesn't work, please ZIP up your block directory and post it here so I can look at your code.
-Jordan
But it sounds like what you really want is the page name, not the description. So try this code instead:
$link_text = htmlentities(Page::getByID($field_6_link_cID)->getCollectionName(), ENT_QUOTES, APP_CHARSET);
If that still doesn't work, please ZIP up your block directory and post it here so I can look at your code.
-Jordan
You are right - page name, not description. Works well - thanks a lot.
Torsten
Torsten
Just one guy here. Yes, this is fairly easy to do. Just edit your block's view.php file and find the code that grabs the link text -- should look something like this:
...and change it to something this:
(NOTE that you'll probably need to change the field number in the sample code I pasted above, depending on how your block is built).
-Jordan