close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

modifying a url?

Thread began 6/27/2012 10:13 am by JamieEff | Last modified 6/28/2012 12:22 pm by Jason Byrnes | 483 views | 3 replies |

JamieEff

modifying a url?

Hey Jason

If I have created a 'Title' entry for a blog or news article, is there any way that I can take that entry and replace all the spacing with hyphens, make it lower case etc and add it to the end of the url that PCMS generates?

Cheers

Jamie

Sign in to reply to this post

Jason ByrnesWebAssist

use strtolower to convert it to lower case, and str_replace to replace the spaces with hyphons:

php:
<?php echo(strtolower(str_replace(" ""-",$row_recordsetName['columnName'])); ?>
Sign in to reply to this post

JamieEff

Thanks Jason

Little confused where and what your example should be and go.

If I have the code as:

php:
<a href="blog-article.php?zzBlogItems=<?php echo $row_BlogRS['ContentPageSetOrder']; ?>"">
<?php
include('WA_CMS/addtosite.php');
echo 
str_replace(array("<p>","</p>"),"",WA_getCMSContent($database_PowerCMSConnection$PowerCMSConnection'zzBlogItems''Title'false$row_BlogRS['ContentPageSetOrder']));
?></a>



I am assuming that I change the code within the <a> tags but when I do, it just shows me an error...

Cheers

Jamie

Sign in to reply to this post

Jason ByrnesWebAssist

you are asking how to modify the link, so yes, you would edit the a href tag.

I'm not entirely sure what your expected outcome is, so can't really give you much more guidance.


this code:
blog-article.php?zzBlogItems=<?php echo $row_BlogRS['ContentPageSetOrder']; ?>


generates the link URL. if the BlogRS recordset returns a Title column and you are trying to add a title url variable, the code for the URL would be:
blog-article.php?zzBlogItems=<?php echo $row_BlogRS['ContentPageSetOrder']; ?>&title=<?php echo strtolower(str_replace(" ","-",$row_BlogRS['title'])); ?>

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...