The Most Active and Friendliest
Affiliate Marketing Community Online!

“AdsEmpire”/  Direct Affiliate

Removing single quote using "replace" in Webmerge

rick52

New Member
affiliate
I've been gaining more and more experience using Webmerge and have found some great resources for information, but right now I am stumped.

I have built a multi-tiered site off a datafeed, with two different structures. First, category, subcategory, and brand. Then, brand, category and subcategory. In the process, I've learned how to join fields in my data with a "/" to create subdirectories, thereby allowing me to have the same named page, i.e. brand.htm. Great!

However, I've now run into a problem. Some of the fields have an apostrophe in them, i.e. Women's Clothing. Webmerge handles them fine in creating subdirectories and files, i.e. the single quote is eliminated. When I create a link to a page that has an apostrophe in it, it finds the name that doesn't have the apostrophe just fine. However, when the page is within a folder whose name used to have an apostrophe, it results in a "webpage not found" message.

I've used the Replace statement to remove spaces and in link names, such as

[wm-field:cat1cat2brand replace(" ","";"&","") nolink].htm"

However, when I to replace the single quote as in "'","" , because the quote is a special character it messes up the html coding below that line. Is there a way to handle this in the replace statement, or do I need to do it in the data?
 
Can you show what the generated output looks like? Normally a single quote within a block of text will not affect rendering in the browser, unless it's part of a string identifier used in a style attribute or JavaScript. Seeing the output will help me understand what's happening in your case.

Thanks -
 
Can you show what the generated output looks like? Normally a single quote within a block of text will not affect rendering in the browser, unless it's part of a string identifier used in a style attribute or JavaScript. Seeing the output will help me understand what's happening in your case.

Thanks -

To re-create it I need to pull the data in without removing the single quote, then create all the pages. The generated output is fine, as WebMerge removes the apostrophe in subdirectories and pages it creates. But when I use a link ON a page, and have "click here to go back...", it keeps the apostophe' in since it's in the data and doesn't work.

href="http://www.abc.com/pages/[wm-field:cat1 replace(" ","";"&","") nolink].htm">Click here to go back to [wm-field: cat1 nolink] main page Note I removed the bracket a in this example so you could see the coding.

Can I make WebMerge remove the single quote in the data, as I have it removing blank spaces and & in my example? If so, what's the syntax, since I can't use "'","" as that messes up the html that follows.
 
I appreciate your including the source segment there. If you could also post that portion of the generated output that'll help me understand what's happening.
 
Richard:

The generated output is a link that says www.abc.com/pages/women'sclothing/purses.htm that is created on a page with that code. I can't recreate it for you as I'd have to redo the data file, run the Webmerge, etc. which is several hours work to clean it up. But since the subdirectory path has an apostrophe in it, it can't navigate to it. If the subdirectory doesn't have an apostrophe, but the page name does, it finds it just fine.

Created pages examples include www.abc.com/pages/womensclothing/purses.htm, www.abc.com/pages/womensclothing/womensclothing.htm.

If there is no way for WebMerge to replace the apostrophes, as I've done with a blank space and an ampersand, then I have to keep removing it manually.

It wasn't an issue until I created the subdirectories, which allows me to have multiple pages with the exact same name, i.e. .../womensclothing/levis.htm. .../mensclothing/levis.htm. Two pages named levis.htm.
 
I guess I'm having problems explaining myself, I'll try again :).

I HAVE removed the apostrophe from the data in Excel, and that works fine, it's just a pain in the butt.

I wanted to know if the REPLACE command could remove the apostrophe, since when I tried to use it, the double quote apostrophe double quote comma double quote double quote did NOT work - the apostrophe is a special character that threw off the HTML. Is there any way around it.

Sorry I'm not being clear. If I leave the apostrophe in the data, it makes a link with .../women'sclothing/women'sclothing.htm. Apostrophe doesn't exist in the subdirectory (since Webmerge removed it), but it's in the link so it doesn't work.
 
The replace option should be working for that. The part I don't understand is "the apostrophe is a special character that threw off the HTML" - normally that's not the case, so if I could see what the output looks like I'll have a better understanding of what's happening.

Feel free to email me one of the generated pages if you prefer: ambassador@fourthworld.com
 
The next time I do the merge I will do it with the replace in there and not removing the apostrophe from the data so I can email you the generated page with the issue.
 
So I just ran the data and created an email to send Richard. All set up, showing him how when the apostrophe is part of a file name it works fine, but when it's in the subdirectory it doesn't work. WebMerge correctly removes apostrophes when it makes the subdirectory name, but then I have no way to refer to the subdirectory since the data still has the apostrophe in it.

While I was creating the email, I wondered what if I used the replace command and replace &#39 with "" instead of trying the actual apostrophe? Well, that worked fine on my test data, now running the entire file (which takes 1/2 hr).

Thanks for trying to help without me showing the proof :)
 
MI
Back