Actionable Holiday Insights on the Next OneTwoPunch Webinar
November 13, 2009 | In General | No CommentsWant valuable tips and advice from a Top 500 Internet Retailer and Yahoo! Store merchant? Then be sure to check out the next OneTwoPunch webinar, on Wednesday, December 9, 2009, at 2 p.m. ET / 1 p.m. CT / 11 a.m. PT.
The OneTwoPunch will be joined by special guest Au-Co Mai, founder of Emitations.com. Au-Co started Emitations.com 10 years ago on the Yahoo! Store platform. Now, it’s ranked #14 in the jewelry category of the Top 500 Internet Retailers, and #1 in costume jewelry. Au-Co will share her story and provide advice to merchants about what they can do to maximize sales in the final weeks of the holiday season.
In addition, Eric Yonge (EY Studios) and Scott Smigler (Exclusive Concepts) will offer site critiques specifically geared towards site improvements that can be made to throttle sales in the last few weeks leading up to the holidays.
Ecommerce Tips on eCom Experts Radio
November 9, 2009 | In General | No CommentsBe sure to catch this week’s eCom Experts radio broadcast, tonight at 6 p.m. ET/3 p.m. PT on WebmasterRadio.FM. Mike Ober (Senior Manager, Merchant Development for Yahoo! Merchant Solutions) will be joining Shawna Fennell (1 Choice 4 Your Store) to discuss ecommerce tips and best practices.
If you miss tonight’s broadcast, this episode will be archived and made available on the eCom Experts web site.
Jennifer Farwell
Yahoo! Small Business
RTML Problems? Missing Expressions May be the Cause
November 3, 2009 | In RTML | No CommentsToday’s Y! Store Blog post comes from Adam Davis, a technical account manager with our customer care team here at Yahoo! Small Business. Below, he shares some of his RTML knowledge to help Yahoo! Store merchants troubleshoot a common issue encountered when building custom RTML templates. Merchants are reminded that Yahoo! Small Business does not offer support for custom templates or RTML customization. The post is recommended for merchants with some understanding of and experience with RTML.
A popular method of building templates in RTML involves using a text field filled with HTML, then placing words inside these HTML tags that are unique enough to be used as an identifier or "token."
Below is an example of an RTML field that contains HTML, which I’ve taken from my own store. In my store variables, I have a med-text field named "site-html." It contains the following HTML:
- <div id="main">
<div id="top-nav"> @@TOP-NAVIGATION@@ </div>
<div id="body">
<p>@@CAPTION@@</p>
</div>
<div id="left-nav"> @@LEFT-NAVIGATION@@ </div>
</div>
In my templates, I call my variable site-html. I use TOKENS to iterate over each piece of the HTML, then execute something where there is a match for my SWITCH keys.
- <RTML>
WITH= variable site-html
value @site-html
FOR-EACH var html
sequence TOKENS site-html
SWITCH html
Key "@@TOP-NAVIGATION@@"
expression CALL :NAVIGATION
"top"
Key "@@LEFT-NAVIGATION@@"
expression CALL :NAVIGATION
"left"
Key html
expression TEXT html
</RTML>
There is a major pitfall when working with this type of template because SWITCH is evaluated from top to bottom, interpreted as alternating key-expression pairs. When a switch expression is evaluated, its value is matched against the keys, the corresponding expression is evaluated, and its value is returned.
When using TOKENS to go over a large block of data, you need to be very careful with the construction of your SWITCH. The most common cause of trouble with a SWITCH is a missing expression.
Taking the above example and adding a new key with no expression will continue to work in Store Editor. However, it will also cause a large number of errors that may result in being unable to publish the site.
- <RTML>
WITH= variable site-html
value @site-html
FOR-EACH var html
sequence TOKENS site-html
SWITCH html
Key "@@TOP-NAVIGATION@@"
Expression CALL :NAVIGATION
"top"
Key "@@LEFT-NAVIGATION@@"
expression CALL :NAVIGATION
"left"
Key "@@CAPTION@@"
expression html
Key TEXT html
</RTML>
This RTML will outwardly work the same as the first example, but there will be an extra overhead for the template due to the missing expression.
It will evaluate something like this:
- no case for:"<div"
no case for:"id=\"main\">"
no case for:"<div"
no case for:"id=\"top-nav\">"
@@TOP-NAV@@ <– will evaluate successfully and call the navigation template.
no case for:"</div>"
no case for:"<div"
no case for:"id=\"body\">"
no case for:"<p>"
@@CAPTION@@ <– will do nothing because when this is called it is in an unactionable context ie: html = "@@CAPTION@@" which does nothing.
no case for:"</p>"
no case for:"</div>"
no case for:"<div"
no case for:"id=\"left-nav\">"
@@LEFT-NAVIGATION@@ <– will evaluate successfully and call the navigation template.
no case for:"</div>"
no case for:"</div>"
As you can see, there are 14 extra lines of overhead from a very simple piece of HTML.
Now you may ask, "Mr. Yahoo, I would like to build out my all my SWITCH Keys, but they do not yet have an expression to evaluate. What do I do?"
The answer is, use "nil,” as in the example below:
- <RTML>
WITH= variable site-html
value @site-html
FOR-EACH var html
sequence TOKENS site-html
SWITCH html
Key "@@TOP-NAVIGATION@@"
expression CALL :NAVIGATION
"top"
Key "@@LEFT-NAVIGATION@@"
expression CALL :NAVIGATION
"left"
Key "@@CAPTION@@"
expression nil
Key html
expression TEXT html
</RTML>
With one more line of RTML, every SWITCH key now has an expression to evaluate, and no errors are returned.
The second situation that can cause a very difficult problem to troubleshoot, yet is easy to see, is a missing expression in the middle of the SWITCH causing garbled output.
- <RTML>
WITH= variable site-html
value @site-html
FOR-EACH var html
sequence TOKENS site-html
SWITCH html
Key "@@TOP-NAVIGATION@@"
expression CALL :NAVIGATION
"top"
Key "@@LEFT-NAVIGATION@@"
expression "@@CAPTION@@"
Key TEXT @caption
expression html
Key TEXT html
</RTML>
This will result in @@TOP-NAVIGATION@@ being evaluated correctly, however every space/tab/ (and in this case @@LEFT-NAVIGATION@@) in the HTML will be replaced with a copy of the caption.
In this example my caption is TEXT " This is my caption " and my top navigation is TEXT "* top navigation bar *".
- –HTML output–
<div This is my caption id="main"> This is my caption
<div This is my caption id="top-nav">* top navigation bar * This is my caption </div>
This is my caption <div This is my caption id="body"
This is my caption <p>@@CAPTION@@</p>
This is my caption </div>
This is my caption <div This is my caption id="left-nav"> This is my caption </div> This is my caption
</div>
–end–
The fix for this issue? Like with the first example, make sure that all of your SWITCH keys have an expression.
- <RTML>
WITH= variable site-html
value @site-html
FOR-EACH var html
sequence TOKENS site-html
SWITCH html
Key "@@TOP-NAVIGATION@@"
expression CALL :NAVIGATION
"top"
Key "@@LEFT-NAVIGATION@@"
expression CALL :NAVIGATION
"left"
Key "@@CAPTION@@"
expression TEXT @caption
Key html
expression TEXT html
</RTML>
I hope these examples assist you with troubleshooting some of your RTML customizations. If you’re not comfortable working with RTML, but wish to customize your store, check out our Yahoo! Merchant Solutions Developer Network for developers who specialize in working with Yahoo! stores.
Adam Davis
Yahoo! Small Business
Powered by WordPress on Yahoo! Web Hosting.
Copyright © 2006 Yahoo! Inc. All rights reserved. Privacy Policy - Terms of Service
RSS 2.0 Feed