RTML: Tips & Tricks
In this entry we are going to share with you a few little known secrets of Yahoo RTML Development. These techniques will greatly enhance your overall store performance and look.
In order to have a successful store, you need to know some additional tricks to operate your store system more efficiently instead of using just the basic functions.
By default, the Yahoo Store System uses pre-defined “availability” options.
In this article, we will show you how to implement a “Custom availability” text field together with a pre-defined property in your store. You should have basic RTML knowledge to use this method.
In order to define “custom availability”, open a list of store Templates. Within the Custom templates column find the template that corresponds to the Item order (this template is a copy of a default template called Item-order).
In this RTML template find the RTML expression WHEN @availability:
WHEN @availability DIV class "itemavailable" TEXT STRING-APPEND GRAB TAG tag "em" TEXT "Availability: " @availability
In this expression change the variable @availability to customavailability:
WHEN customavailability DIV class "itemavailable" TEXT STRING-APPEND GRAB TAG tag "em" TEXT "Availability: " customavailability
Create a New RTML operator WITH= and paste the above expression into it. In this operator, assign the variable value to customavailability:
WITH= variable customavailability value nil WHEN customavailability DIV class "itemavailable" TEXT STRING-APPEND GRAB TAG tag "em" TEXT "Availability: " customavailability
Create a New RTML operator IF to check @custom-availability and @availability fields. Pass IF to WITH= operator:
WITH= variable customavailability value IF test NONEMPTY @custom-availability then @custom-availability else @availability WHEN customavailability DIV class "itemavailable" TEXT STRING-APPEND GRAB TAG tag "em" TEXT "Availability: " customavailability
Finally, define the custom property @custom-availability (type text) in the item page or at the item type and fulfill it with its necessary value.
If you didn’t already know, the Yahoo built-in function “Multiple Image Upload” (located at the “Control” page) does not allow you to upload Icon and Inset images.
Usually you have to go through all the pages manually and upload the icon or inset one by one, which takes up a lot of useful time.
How this process could be automated:
You can use a combination of two procedures: “Database Upload” and “Multiple Image Upload.”
1) Create an Excel .CSV spreadsheet file with two columns: ID and Icon
In each row enter the corresponding values that apply to the two columns: the page ID (where the Icon or inset should be uploaded to) and the image name (without the file extension). List as many page ID’s as you need.
Save this file in .CSV format and upload it to your store using the “Database Upload” feature. Make sure that you click the ADD button when uploading. Never click the REBUILD button, because it will wipe out your entire store content.
2) Create a ZIP archive with all the images you had listed in your .CSV file. Upload this file through Yahoo’s “Multiple Image Upload” feature.
From now on, all the pages listed in your spreadsheet will display the Icon image that you defined and uploaded.
3) Repeat these two steps for your Inset images. Instead of having an Icon column in your .CSV file, name it Inset and type in the inset image names for each corresponding page row.
You could combine the .CSV document to have the Icon and Inset columns in one file.
Pay attention: if the column Icon or Inset will have an empty cell, but the corresponded page already has these images uploaded, then the icon or inset will be erased from the page during the DB upload.
If you are interested in having more than one inset at store pages and want to have customized Inset names, visit our “Add-ons” page: http://www.alphastoredesign.com/additions/multiple-insets.html
For more information regarding uploading .CSV data, please visit the Yahoo help page: http://help.yahoo.com/l/us/yahoo/smallbusiness/store/edit/advanced/advanced-01.html
Let’s suppose that you’ve just opened a brand new Yahoo store account. You’re excited and ready to put up your items for sale. But hold on a second. Before you upload the inventory items we insist that you follow these steps to create a list of Editable Templates.
By default RTML templates cannot be edited. To be capable of enhancing these templates, you need to make copies of all your base templates. This is a necessary step because afterwards, these template copies and newly created templates will have the possibility of being altered and edited.
As we have already said, you must make this list of Editable Templates before you upload any items because it will help you avoid the process of changing the templates for each item one by one.
So how does someone create a list of Editable Templates?
The first step you must take is to turn on the Advanced Editor Mode in the Control panel.
You will now see a second row of control buttons on the bottom of your main page
-Click on the tab called “Contents”
-In the contents page, click the yellow button named “Templates”
-Once you access this page you will see a list of all the templates.
-Find the template “Storetemplate.” and click to open it.
-Find the “Copy Template” button and click it.
-There will be a field that will appear where you have to type in a name for the new template. An example could be, “New-Storetemplate”
-Click the “Copy” button.
Congratulations. You have successfully created a List of Editable Templates! To recap, this was made possible through a process of copying the parental template (Storetemplate). Afterward, the RTML system automatically copies subsequent templates on it’s own, and all you need to do is apply this new template to your store pages by editing the store properties. This method will benefit you because you will have fewer pages to edit, and your workload will greatly decrease.
For example, let’s edit the first page of the site (Home page). Open up the Home page and click Edit. Then within the “Template” property change Storetemplate to New-Storetemplate and click on the Update button. Do not worry; the page layout will remain the same, because the new template is the exact copy of the old one.
Finally, all you need to do is apply some changes to the Config page. This is marked by a yellow button called “Config” at the top or bottom of your store pages (depending on the page settings).
When you are in the Config page you must edit three drop-down menus (Default-item-template, Default-section-template, Default-group-template) and change Store-template to the new editable template.
As a result of taking these steps you now have the possibility to edit templates and to have all newly created pages under an editable template by default.
In our future articles we will discuss how to improve your Yahoo Store functionality by adding some small changes to the templates.
1) To add “Bookmark & Share” button to store pages, go to www.Addthis.com first and receive the code from there.
There is the example of such a code:
<!– AddThis Button BEGIN –>
<!– AddThis Button END –>
Note: If you want to get the sharing statistics, you have to register on addthis.com.
2) Create a global variable -share-code (med-text) and place and paste the code into it. See more details here: http://www.alphastoredesign.com/blog/2010/03/11/how-to-add-global-or-local-properties ).
3) Open a list of store Templates. Then find custom Item-order template.
Click on it and open.
Find the RTML expression:
WHEN OR @price @sale-price
Click on WHEN.
Click the “New” button and create a TEXT operator. Then click the “Paste After”. After this click the “EDIT” button and set the value of TEXT operator to @-share-code
After these simple procedures the “Add This” button will appear on every item page near the “Add to Cart” button.
In the previous “Custom Availability” post we explained how to use the Custom Availability property together with the system Availability property. This method requires basic RTML knowledge.
Next, we will show you how to implement a “Custom availability” text field instead of using the pre-defined property Availability. This method is simpler than the previous one.
First, open a list of store Templates. Then find custom Item-order template.
Click on it to open.
Find the RTML expression WHEN @availability.
Click on @availability.
Click the “New” button and create a NONEMPTY operator. Then click “Replace”. As a result, the NONEMPTY RTML operator will replace the original @availability expression.
Click the “EDIT” button and set the value of NONEMPTY operator to @custom-availability
WHEN NONEMPTY @custom-availability
Find the RTML expression STRING-APPEND:
TEXT STRING-APPEND GRAB TAG tag "em" TEXT "Availability: " @availability
We have to replace @availability property with @custom-availability. For this purpose click on the STRING-APPEND operator and then click the EDIT button. Change @availability to @custom-availability and click update:
WHEN NONEMPTY @custom-availability DIV class "itemavailable" TEXT STRING-APPEND GRAB TAG tag "em" TEXT "Availability: " @custom-availability
Finally, define the custom property @custom-availability (type text) at the item page or at the item type and fulfill it with its necessary value.
By default, the Yahoo store system does not include a quantity box on its store pages. After a few changes in the RTML template it will be possible to apply this feature, and customers will then have the possibility to order more than one item.
First, make sure you have editable copies of your store RTML templates.
Find the template that corresponds to adding the items to the shopping cart. Because it is a copy of a default template called add-to-cart, it will be named something such as, your-store-add-to-cart. Click and open it.
Now you will see the template content. At this point, we recommend you make a copy of your existing template by clicking the Copy Template button (just in case if you need to restore it).
At the top of the template content click the operator “IF”. It will become active (not linked, black colored).
Click the button [NEW] at the toolbar. There you will see a selection field called “Complex”, scroll within it to find the operator “INPUT”.
Click the button [CREATE]
The newly created operator will appear in the “basement” area, below the template content. We need to place it before the recent operator IF.
Now, “IF” is active. “INPUT” is in the basement. Click the button [Replace] in the toolbar. These operators will then rotate their places: “IF” will go to the basement area, “INPUT” will become the first operator (active). Now click the button [Paste After] and then “IF” will be replaced after the “INPUT”.
The last step is to customize the operator “INPUT”.
Click it to make it active. Click the button [EDIT] in the top toolbar. Define the following values:
Name – :vwquantity
type – :text
value – 1
maxlength – 3
size – 3
All done. The quantity box will now appear at your store item pages.
You are currently browsing the archives for the RTML: Tips & Tricks category.