td tag with expander class in Zurb Ink is necessary? - zurb-ink

Is it necessary to add a td tag with class expander inside every table containing one or more td tags? I had a issue with sub-grid which I posted here. I solved it by adding
<td class="expander"></td>
after the last the td tag using sub-columns and it did solve the problem. Also, the Ink documentation doesn't explicitly specify whether to to add the expander.

td.expander must added inside every table:
http://foundation.zurb.com/emails/docs.html#if-fullWidth

Related

capybara find and save text value from a page

i am in the process of writing a Capybara Automation suite. one thing that i am trying to do is extract a value between the td tags from the html source
<td class="table-column-data">CB/AE9999XX/A001</td>
i.e. find and extract the value CB/AE9999XX/A001 then save it into a variable to use later on.
i hope you can help
thanks
saved_text = find("td.table-column-data").text
Will get the text from the element - obviously the selector passed needs to select a unique element, which will depend on the surrounding html
You can use the below mentioned way to extract and save the value in a variable:
extractedValue = find('.table-column-data').text
This will fetch the text "CB/AE9999XX/A001" and store it in the variable "extractedValue".
Apart from this, you can also extract the text using jquery as shown below:
extractedValue = page.evaluate_script("$('.table-column-data').text()")
Hope this helps :)

Reg Expression, Handling a URL exclusions

I am trying to write a regexp to use with Crazyegg that will allow me to only gather data from my product pages.
My site structure is:
category page: www.sitename.com/categoryname/sub-categoryname
product page: www.sitename.com/productname/
My regex so far is:
^https?://([A-Za-z0-9.-]*\.)?sitename\.com/[A-Za-z0-9.-]*(/|/\?|)$
This allows everything that isnt at the sub category level (2nd level folder?)
the issue is that this allow top level categories so I need to exclude these by their name for example:
^https?://([A-Za-z0-9.-]*\.)?sitename\.com/(?!\babout\b|\bcheckout\b)(/|/\?|)$
Could you please help me get the exclusion correct? ive also tried doing using [^\babout\b|\bcheckout\b]
if you only want product pages, the regex for capture product pages is:
".*productname"
For capture category pages: ".*categoryname/sub-categoryname"
I hope help you. If you have more questions, ask me!

Use Yahoo Pipes to convert RSS html tags to standard tag items

I want to move from using bookmarking service Delicious to Diigo, but the way diigo organise tags in their RSS is preventing the move.
I want to use a Yahoo Pipe to turn Diigo rss tags into the same format as Delicious rss tags
Diigo tags are stored as a html list at the bottom of the 'Description' item, like this:
Some test describing the link.
<p class="diigo-tags"><strong>Tags:</strong>
<a rel="nofollow" target="_blank" href='https://www.diigo.com/user/username/firsttag'>firsttag</a>
<a rel="nofollow" target="_blank" href='https://www.diigo.com/user/username/2ndtag'>2ndtag</a>
<a rel="nofollow" target="_blank" href='https://www.diigo.com/user/username/anothertag'>anothertag</a>
etc... </p>
I need to extract each of these and store them in their own item. Delicious stores each tag in a nested field category by number, like this:
category
0
domain http://delicious.com/username/
content firsttag
1
domain http://delicious.com/username/
content 2ndtag
So, the Yahoo Pipe needs to strip the html list and separate each tag into single category fields.
Not sure where to start, except maybe this regular expression in regex to strip the html:
(?si)<a[^<>]*?[^<>]*>(.*?)</a>
Any advice appreciated.
You can extract the tags from the diigo stream by performing the following replacements using the Regex operator:
replace <a[^<>]*?[^<>]*>(.*?)</a> with $1, using options g and s (the tag itself within the <a>...</a>)
replace <.+> with nothing, using options g and m (delete all HTML tags)
replace [\s]+ with a single space, using options g and s
As a result, the description field now contains the list of tags separated by spaces. I'm not sure what you need next, if you tell me I can try to help.
Here's the pipe:
https://pipes.yahoo.com/pipes/pipe.info?_id=1656d9fcab9d9ed6016bdae7486ee71f
UPDATE
I see, the tricky part is adding multiple category nodes to an RSS feed. Unfortunately, I don't think that's possible. I updated the pipe, so that now you have item.category.1, .2, .3, and so on, but when you look at the RSS output of the pipe, it doesn't show any categories. (I think this might be related to the fact that the Create RSS operator doesn't have a category field either.)
In the JSON output there are multiple categories correctly.
I also tested that if there is only one category field, it would show up correctly in the RSS output. If there are more than one then no.
And I'm afraid this is as far as I can get you.

Is there an alternative to "keep-together='always'" on table-row?

Upon finding the "keep-together" attribute, and needing to not page break inside a row I added keep-together="always" on every table-row element in my xslt.
Is there a nicer way of achieving the same effect? It seems a bit hacky.
(ps. I will accept "no" as an answer if no one provides a better one, provided some kind of explanation is proffered.)
keep-together="always" is dangerous because that's a compound property that also indirectly sets keep-together.within-line="always" (prohibiting line breaks inside a table-cell). You should use keep-together.within-column="always" instead. But specifying that on a table-row is actually the way to go. Nothing hacky about it.
See also: http://www.w3.org/TR/xsl11/#datatype
I have used the following three methods to keep table rows together with some success:
Keep whole block together
<tr keep-together.within-page="always">
...
</tr>
Keep adjacent blocks together
<tr keep-with-next.within-page="always">
<td keep-together.within-page="always">...</td>
...
</tr>
<tr>...</tr>
<tr>...</tr>
<tr keep-with-previous.within-page="always">
<td keep-together.within-page="always">...</td>
...
</tr>
Though you have to be careful - if the row or cell would span more than one page of a generated document, you will loose the bottom of that page off the bottom!
This answer solved my problem of a table row that was flowing over a page break when i needed to lock the table together. i used the <fo:table keep-together="always"></fo:table>
Thanks.
With an XSL formatter that handles integer keeps, you can use an integer value so that the formatter will try to keep the row together but will break the row rather than run off the end of the page. However, this question is tagged for FOP, and FOP's compliance page currently states that it has limited support for integer keeps (http://xmlgraphics.apache.org/fop/compliance.html#fo-property-keep-together), so YMMV.

Displaying extra field - specification in store front end

I have added an extra field Specification in Catalog->Product->Data tab.
This text is stored in a column called specification in product_description table.
Now I want to display this information in my Store Front (default theme). On product page there is a tab Specification that displays attribute. I want to display specification instead of attribute.
Please suggest me how to do it :(
First: edit Your Product model - should be in catalog/model/product/product.php - find the method getProduct and edit the SQL that selects the product details to also get the specification column.
Second: edit Your Product controller - should be in catalog/controller/product/product.php and make sure that Your specification column will be added to $this->data['specification'], e.g.
Third: edit Your Product detail template - should be in catalog/view/theme/default/templates/product/product.tpl and find that part where <div class="tabs"> (or similar) is - then find the tab for specification and print out Your specification column here...
Should be done.