Results 1 to 10 of 19

Hybrid View

  1. #1
    Join Date
    Apr 2010
    Posts
    897
    Plugin Contributions
    0

    Default Trying to us html in a define... HELP PLEASE!

    When I use quote marks ( " ) in a define, the quote turn into unicode ( ").

    I added this as my defined HEADER_SEARCH_BUTTON in includes/languages/english/MY_TEMPLATE/header.php:
    <i class="fa fa-search" aria-hidden="true"></i>&nbsp;Search

    When I load the page and check source, finding this:
    <i class=&quot;fa fa-search&quot; aria-hidden=&quot;true&quot;></i>&nbsp;Search

    Can somebody tell me how to escape those quotes? Or is that not my issue?

    ++++
    In case you want to see what it does, check the search button on the right of my top blue bar:
    https://002mc.justmedical.biz/Produc...-Test-1-Images

  2. #2
    Join Date
    Apr 2010
    Posts
    897
    Plugin Contributions
    0

    Default Re: Trying to us html in a define... HELP PLEASE!

    Headed in the right direction... ?

    I changed this:
    define('HEADER_SEARCH_BUTTON','<i class="fa fa-search" aria-hidden="true"></i>&nbsp;Search');

    To this:
    define('HEADER_SEARCH_BUTTON',print '<i class="fa fa-search" aria-hidden="true"></i>&nbsp;Search');

    Seemed helpful-ish.

  3. #3
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Trying to us html in a define... HELP PLEASE!

    Why not try instead of "
    To use \"
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Apr 2010
    Posts
    897
    Plugin Contributions
    0

    Default Re: Trying to us html in a define... HELP PLEASE!

    I'm pretty sure my define is getting cleaned. Even when I escape the quote mark ( \" ), I wind up with ( \&quot; ).

    Using "print" is the closest I've gotten. When I do that, the icon I want shows up, but it's at the very top of the screen and cannot be touched. Also the print default value of "1" shows up in the search box.

    I'll leave it like that for a while, I guess. I enlarged it to make it easier to see. But you have to look at the upper left corner of the page to see the icon. And you can see the number "1" on the button to the right of the search input box.

  5. #5
    Join Date
    Apr 2010
    Posts
    897
    Plugin Contributions
    0

    Default Re: Trying to us html in a define... HELP PLEASE!

    MC, I can put that escaped define back in if you want.

    But this is what it yields:
    <i class=\&quot;fa fa-search\&quot; aria-hidden=\&quot;true\&quot;></i>&nbsp;Search

  6. #6
    Join Date
    Apr 2010
    Posts
    897
    Plugin Contributions
    0

    Default Re: Trying to us html in a define... HELP PLEASE!

    Btw, I've used that trick ( \" ) effectively in this EXACT cart. But that was for a language file in the admin.

    What I'm thinking is that there must be a cleaner in place, just in case folks try to use bad characters in the catalog language defines. I just need to figure out what's calling that and kill it!

  7. #7
    Join Date
    Apr 2010
    Posts
    897
    Plugin Contributions
    0

    Default Re: Trying to us html in a define... HELP PLEASE!

    Small victory: I just managed to insert a symbol into a product description by inserting the call ( <i class="fa fa-search fa-5x" aria-hidden="true"></i> ) directly into the database (rather than using the admin product update page).

    https://002mc.justmedical.biz/Produc...-Test-1-Images

  8. #8
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Trying to us html in a define... HELP PLEASE!

    Quote Originally Posted by Feznizzle View Post
    Btw, I've used that trick ( \" ) effectively in this EXACT cart. But that was for a language file in the admin.

    What I'm thinking is that there must be a cleaner in place, just in case folks try to use bad characters in the catalog language defines. I just need to figure out what's calling that and kill it!
    But this is also a language file, no? Thought we were talking about trying to use standard HTML in the language header define HEADER_SEARCH_BUTTON which when I did a search for that I didn't find on a standard ZC install that the define was even used in the common/header.php file on the store side. What that means is that yes where it is being used as the output it is being sanitized by the display code.

    Now as for entering data in the admin and it being sanitized? Yes there is expected to be a level of that performed and what/how it is sanitized depends on the field and how it is used. The thing is, the sanitization is intended to offer a level of protection by not storing some items as raw html in the database as a security measure.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Aug 2005
    Posts
    334
    Plugin Contributions
    0

    Default Re: Trying to us html in a define... HELP PLEASE!

    Quote Originally Posted by Feznizzle View Post
    Small victory: I just managed to insert a symbol into a product description by inserting the call ( <i class="fa fa-search fa-5x" aria-hidden="true"></i> ) directly into the database (rather than using the admin product update page).

    https://002mc.justmedical.biz/Produc...-Test-1-Images
    Can you please share how did you replace word "search" withAttachment 17536

    Thank you.

  10. #10
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Trying to us html in a define... HELP PLEASE!

    Quote Originally Posted by Feznizzle View Post
    I added this as my defined HEADER_SEARCH_BUTTON in includes/languages/english/MY_TEMPLATE/header.php:
    <i class="fa fa-search" aria-hidden="true"></i>&nbsp;Search
    To go back to your question.. CSS button relies on the ALT define not the button image define.. If for some reason like the CSS failed or you needed to switch back, then the button image is used. I found for buttons within forms, I had to use the font number and for links the html tags and class.
    Code:
    define('BUTTON_SEARCH_ALT', '&#xf00e; Search');
    Code:
    define('BUTTON_CREATE_ACCOUNT_ALT', '<i class="fa fa-user-plus"></i>  Sign Up');
    I also had to edit html_output.php to kill the js switch in forms..
    PHP Code:
    $css_button_js .= '';   // 'onmouseover="this.className=\''. $mouse_over_class . '\'" onmouseout="this.className=\'' . $mouse_out_class . '\'"'; 
    But that could be just the way I have CSS buttons set-up.. I don't like the standard box look..
    Dave
    Always forward thinking... Lost my mind!

 

 

Similar Threads

  1. Replies: 7
    Last Post: 23 Apr 2017, 06:39 AM
  2. Define in Help Please. Newbe
    By Moneyshott in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 15 Dec 2011, 12:38 AM
  3. Please Help trying to setup PayPal Pro
    By ellisn in forum PayPal Website Payments Pro support
    Replies: 17
    Last Post: 9 Aug 2008, 12:12 PM
  4. Page Define Help Please
    By caradelrae in forum Basic Configuration
    Replies: 1
    Last Post: 30 May 2006, 06:26 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR