Add URL link to an information Attribute?
It is possible to create a clickable weblink within the option value of a Read-only attribute?
For a certain group of products, I would like to display a comment referring the customer to an information page. Yes, I can probably add it into each product description but applying an attribute to a category seems more efficient, so thought I would throw the question out there.
And sorry if this is already posted somewhere. I did search first.
Thank you.
Matt
Re: Add URL link to an information Attribute?
Quote:
Originally Posted by
apollowilcox
It is possible to create a clickable weblink within the option value of a Read-only attribute?
For a certain group of products, I would like to display a comment referring the customer to an information page. Yes, I can probably add it into each product description but applying an attribute to a category seems more efficient, so thought I would throw the question out there.
And sorry if this is already posted somewhere. I did search first.
Thank you.
Matt
What has been tried?
What has been the result of your attempts?
Generally speaking, I would **think** that an html link could be written into the read-only attribute, but I'm not sure what admin sanitization is in place to know if/how it may get modified in making the save...
This post doesn't answer your question but hopefully through prompting you'll come back and educate others on what you found, whether successful or having more questions.
If something has already been tried but has been unsuccessful, giving that info up front really helps to get you helped...
Re: Add URL link to an information Attribute?
You bet. I am not a high-level programmer but can usually read/ understand other coding and re-apply it. I added into this particular attribute text the <a href=... </a> sequence. All the public page displayed was that exact text without any link.
The fact that no loading error or error message/log was created suggested to me that it was not unhappy with my code, just ignoring it. I figured that, unlike the Rich Text editing available within product descriptions, the attributes value field is Plain Text and cannot display as html.
Then I made this post hoping someone might tell me it was possible. :D
Re: Add URL link to an information Attribute?
Not sure when I'll have a chance to try to reproduce or review the applicable code section, but might suggest also looking at the html code (source code) on that area to see if it is like:
[nopase]%lt=[/noparse]
Otherwise, maybe someone else can come in to help further.
Re: Add URL link to an information Attribute?
I've put hyperlinks into read-only rext attributes.
(SEE AN EXAMPLE) https://tagmakers.co.uk/numbered-pla...white-on-black
With the "For Custom Sizes" attribute.
In my example:
OPTION NAME: For Custom Sizes
OPTION VALUE: <a href="http://tagmakers.co.uk/forms/view.php?id=10596">GO HERE</a>
-------------
MC12345678 mentions the possibility of SANITIZING... This is when input HTML is "sanitised" and instead of remaining code, renders as text.
I have bypassed sanitization by going into the database (via phpMyAdmin) and adding the Option Value to the relevant option name in the database.
Unless you know what you are doing in database editing, don't try this! Messing the database can (and usually does) cause big problems.
Re: Add URL link to an information Attribute?
Thank you schoolboy. This gives me hope that it will work and i simply had the code wrong - although my code was nearly identical to yours. I'll try it again! Thanks for taking the time to reply. Best regards,