Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: Article Manager 2:
Replacing part of a string

 

 


glevine
User

Mar 18, 2008, 8:31 AM

Post #1 of 2 (307 views)
Shortcut
Replacing part of a string Can't Post

Is there a way to replace only part of a string using one of the placeholder modifiers? I'm trying to add a photo of the author at the template level and I want to avoid using javascript.

The photo filenames are the author's full name without spaces. The code I was trying to use was:


Code
<img src="/photos/$article.author:lowercase:replace(' ','')$.jpg alt="$article.author:htmlEncoded$" align="right" />


Unfortunately, this was a misuse of replace. Replace matches the entire string in the placeholder, not a substring. Is there any way to do what I was attempting?

Thanks


Donna
Staff / Moderator


Mar 18, 2008, 1:38 PM

Post #2 of 2 (302 views)
Shortcut
Re: [glevine] Replacing part of a string [In reply to] Can't Post

Hi there,

Replace won't work the way you're expecting as that will only match the entire value. However, there are a few ways you could get around that. One, if you've got a limited number of authors, you could simply create a pre-defined dropdown field for each of your author images, and have the "value" set to the filename for that author.

Alternately, you could use the ":urlEncoded" option, and save the files as Firstname%20Lastname.jpg ("%20" being the URL encoded value for a space.)

Would either of those methods work for you?

Donna


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4