Markup tags in product descriptions - magento

I'm trying to use markup tags to link to info pages within the "description" attribute of a product. However, it's not giving me a clean URL path when the description is printed to the page.
Trying:
Contact Us
does not give the expected url. I've confirmed i'm doing this outside of WYSIWYG mode too.
When the text is rendered is returned to the browser as this html:
Contact Us
A resulting click on the link then ends up as:
http://example.com/prod-category/my-product/%7B%7Bstore%20url=
From what I can tell the markup tags aren't designed to be used in this way. Is it possible to extend it so it could work? Otherwise I guess I need to include the actual URL in the description?
Thanks for suggestions.

You can´t use the double-curly syntax because the attributes value is not being processed by magento´s template filter, which does the magic. You can use them e.g. in CMS or email Templates out of the box.

Related

Uipath studio- data scraping error appear after I modified the selector

I use UiPath and data scraping activity. First open the browser direct to the e-commerce site and search the product. Everything is fine, until after the product was searched and results were shown, the data scraping stopped and the output gives the following error message which I couldn't understand why:
This is because I had previously edited the selector. Currently, my selector is:
<html app='chrome.exe' title='Qoo10 - "ItemsFList" Search Results : (Q·Ranking): Items now on sale at qoo10.sg' />
My previous selector did not causes any error and the selector was:
<html app='chrome.exe' title='Qoo10 - cooking oil; Search Results : (Q·Ranking): Items now on sale at qoo10.sg' />
The ItemsFList is actually a String variable I created. This variable stores a list of text in String format. It stores the exact same text as the rpa input into the search box at the e-commerce site when the rpa begins running.
UiPath tries to write as specific a selector as it can based on the data you provide it. Unfortunately, sometimes that selector is too specific.
For example, when you scrape a page, it includes the title of the page in the selector. But the page title will change if you are looping through more than one page. And sometimes the page title is completely dynamic, perhaps including a variable that changes every time the page is loaded. If the title is hard-coded into the selector, your program will only work if that page remains constant, which rarely happens.
Remove the title
You can use wildcards in the title to make this part of the selector more generic. Quite frankly, my experience is that that title is rarely needed at all, so I just remove it whenever I do a UiPath web scrape of HTML pages.
As you can see in the image below, the title is deselected. You can then click the orange ? Validate button to confirm that the page scraping will still work without the title. If everything goes green, you're good to go.
As you've found, the title almost always gets in the way.
The issue is your UI selector. It is clear with your error as you can see the title is dynamic and you're relying on the title to find the browser window or browser control. You have to make your selector more generic and than it should work. Try go through the UI explorer or UIPath Documentation. The few options you can try in your selector is:
Remove title from the selector <html app='chrome.exe' />
Or make Title generic
<html app='chrome.exe' title='Qoo10 - *' />
Note the * sign in the title that will make it more generic and please go through their documentation

Setting Mailchimp campaign content html not working

I tried to update my campaign html content using mailchimp api:
/campaigns/{campaign_id}/content
You can find more information about this api here: https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/content/#
Before sending a campaign, I tried to get campaign content html, modified it and then set campaign content html using above api. I just simply use BeautifulSoup to append a new tag to content body:
content.body.append(BeautifulSoup('<p>Mailchimp is freaking shittttt</p>'))
Then, some interesting things happen, the first campaign I created, it works fine, the tag added appears in my email. But, then the sub-sequence campaigns not working anymore, the tag added not appearing.
I observed something strange on my mailchimp campaign site, even though I set campaign html content, only Plain-Text Email gets changed (HTML Source still the old version) for both working and not working campaign.
Anyone got this issue before?
I had a similar issue and I had to take a slightly different approach to solve it. According to this answer by Joel H., "MailChimp doesn't allow updating the campaign's HTML content because the campaign type is based on a template. In order to update the HTML content, the campaign has to be set to custom HTML instead of a template."
That solution didn't suit me but it led me to another solution: creating a template, creating editable content areas within that template, and then using the API to retrieve and edit the text in those content areas.
Here is an attempt at adapting my code to solve your problem. I'm using Python 3 and the mailchimp3 client.
default_footer_content = client.templates.default_content.all(template_id=TEMPLATE_ID)['sections']['SECTION_NAME']
new_footer_content = default_footer_content.replace(PLACEHOLDER, 'Mailchimp is freaking shittttt')
client.campaigns.content.update(campaign_id=CAMPAIGN_ID, data={'template': {'id': TEMPLATE_ID, 'sections': {'SECTION_NAME': new_footer_contennt}}})
Some pointers on the above code:
You can find TEMPLATE_ID with the API or simply by copying the numbers at the end of the URL when editing the template in the web interface
You define SECTION_NAME by placing 'mc:edit="SECTION NAME"' in the appropriate place in the template
I've used .replace() rather than .append() so you will need to put PLACEHOLDER or similar at the appropriate place in the template
I hope that helps, happy to modify my answer if it needs more clarification. This is my first answer on Stack Overflow so constructive criticism appreciated :)

CKEditor and HTML in Xpages

I am understanding this better but still not there yet.
I have a notes document with a rich text field. I want to edit it in Xpages, so that the user can enter text for an email that an agent will generate. The idea is that the user should be able to enter styled text, hopefully including pasted graphics, and this is saved to the rich text field in such a way that a later agent can copy that field to the body of an email.
On the form I have checked the field "Store contents as HTML and MIME.
In the Xpage I have bound the CKEditor directly to the field (can bind it to a scope variable if necessary).
The code in my agent is as follows:
Set rtItmFrm = emlDoc.getFirstItem("Body")
Set rtItmTo = New NotesRichTextItem(mail,"Body")
Set rtItmTo = rtItmFrm.Copyitemtodocument(mail,"Body")
Any further suggestions on reading up on MIME/CKEditor etc would also be much appreciated.
Bryan
=========================================================================
I just discovered how to modify the CKEditor in Xpages (the Rich Text Control). I have the full menu and one or two more things turned out. However, I am really puzzled by how it treats HTML. I would like to put a template for a nice HTML email (like a newsletter). Anything even a little complicated it munges and the output is messed up.
I read enough online to understand that it is not supposed to be a HTML editor, but I am really having trouble getting the results I want. I would love to put some basic skeleton HTML in there, but everything but the simplest code doesn't work.
Is there anyway to import HTML and it not get messed up using this editor?
as Per and Stephan said, Have a look at ACF filtering that is 'server side' (This is not related to CKEditor itself, but it is related to XPages).
If you have a look at the inputRichText control you will see 2 properties.
htmlFilter
htmlFilterIn
These properties determine how to filter Html on the way in to your data, and also on the way out.
This can be used to strip styling out, and also to prevent dangerous tags like some bad code here etc.
By Default the htmlFilter is set ACF (Active Content Filtering) if you look at the default rules, you will see it strips things like 'margin' out.
see /properties/acf-config.xml-sample
There is a filter called 'identity' which means don't filter anything, however beware if you use this you are not protected from and maliciously entered html.
You should look into defining your own set of rules for your ACF filter, this way you can choose which elements to remove. There is a section in Mastering XPages book about this.
If you still have any trouble, then there are some settings in CKEditor config which also control ACF (totally separate to XPages server side)
I don't think CKE changes the HTML, it is the writing back to a RT field.
Try and bind your RichText Editor to a scoped variable instead of a RichText field. This way you have access to the raw HTML and can use that to generate a MIME email. You might want to have a look at Mustache for mail merge.
Use this article series as starter how to prepare CK editor to make this possible.
And as Per mentioned: check the filtering.

Tumblr: how do I remove the description/sidebar box on the submit page in the default Peter Vidani theme?

I have a tumblr account that has submission enabled, and I have a short description with a form in the "description" area that appears on the sidebar. However, this description also appears on myblog.tumblr.com/submit. I'd like to remove it.
I looked at the documentation on http://www.tumblr.com/docs/en/custom_themes#navigation, but haven't been able to figure out how to prevent the sidebar description from showing at the top of the submit page.
Can anyone help?
I'm not sure if I understood your question correctly. But if I did, a work around would be using jQuery to check if the current url contains the string /submit and simply disable the sidebar, or the element that contains the description.
I don't know jQuery but I know it's possible. I'd suggest you to look into this post:
How to check if the URL contains a given string?
and combine it with this line (replace the "alert part")
$("#sidebardescription).hide();
Another solution would be if Tumblr provided you with a way to only render for specific pages. They usually do that. I'd look into this part {block:SubmissionsEnabled} {/block:SubmissionsEnabled} before I go with the workaround.

How do I display "News" on the Home page? (Magento)

I need news articles to be displayed on the front page but the standard way, to put this code {{block type="profile/profile" name="profile" template="profile/news-front.phtml"}} in the editor on backend doesn't work, even though I have created file news-front.phtml in the template/profile. I really-really need help with this. The output in system.log is Not valid template file:frontend/base/default/template/profile/news-front.phtml
Is the block type really going to be profile/profile? If you are just hoping to output the file as PHP/HTML you may want to consider using core/template rather than profile/profile.

Resources