Jump to content

Add select menu with anchor tags on CMS Page


Recommended Posts

Hey guys,

 

I'm trying to add a select menu to anchor points on my prestashop CMS page, keep getting this annoying message 

 

The content field is invalid.

 

Page in question http://www.diysecuritycameras.com.au/content/firmware-downloads.html

 

Code it's having issues with:

 

Running PS 1.6.1.4

 

If I remove the "onchange="top.location.href=this.options[this.selectedIndex].value;" it allows me to save but then I can't get the menu to work

<div style="float: right; padding-bottom: 11px; padding-right: 85px;">
<select id="navigation" onchange="top.location.href=this.options[this.selectedIndex].value;">
     <option selected="">--- FIND YOUR FIRMWARE ---</option>
     <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html">--- NVRs ---</option>
     <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#nvr">- NVR 1</option>
      <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#nvr">- NVR 2</option>
       <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#nvr">- NVR 3</option>
        <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#nvr">- NVR 4</option>
         <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#nvr">- NVR 5</option>
     <option value="how-to-setup-hikvision-surveillance-with-blueiris-pg02.php">--- CAMERAS (2 LINE - 2MP/4MP) ---</option>
     <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#2mp">- Camera 1</option>
      <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#2mp">- Camera 2</option>
       <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#2mp">- Camera 3</option>
        <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#2mp">- Camera 4</option>
         <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#2mp">- Camera 5</option>
     <option value="how-to-setup-hikvision-surveillance-with-blueiris-pg02.php">--- CAMERAS (2 LINE - 3MP/1.3MP) ---</option>
     <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#3mp">- Camera 1</option>
      <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#3mp">- Camera 2</option>
       <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#3mp">- Camera 3</option>
        <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#3mp">- Camera 4</option>
         <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#3mp">- Camera 5</option>
     <option value="how-to-setup-hikvision-surveillance-with-blueiris-pg02.php">--- CAMERAS (4 LINE - Darkfighter) ---</option>
     <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#darkfighter">- Camera 1</option>
      <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#darkfighter">- Camera 2</option>
       <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#darkfighter">- Camera 3</option>
        <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#darkfighter">- Camera 4</option>
         <option value="http://www.diysecuritycameras.com.au/content/firmware-downloads.html#darkfighter">- Camera 5</option>
</select>
</div>
Edited by motion2082 (see edit history)
Link to comment
Share on other sites

For security reasons, PrestaShop doesn't allow JavaScript in CMS page content. Have you tried going to Preferences > General and changing "Use HTMLPurifier Library" to "No"? If that doesn't work, I guess you have to add it in cms.tpl inside your theme instead. You could change line 40 from:

{$cms->content}

to:

{if $cms->id == 1}Put your content with JavaScript here{else}{$cms->content}{/if}

Change 1 to the ID of the "Firmware downloads" page. This will override the CMS content just for that page.

Link to comment
Share on other sites

For security reasons, PrestaShop doesn't allow JavaScript in CMS page content. Have yout tried going to Preferences > General and changing "Use HTMLPurifier Library" to "No"? If that doesn't work, I guess you have to add it in cms.tpl inside your theme instead. You could change line 40 from:

 

Bugger, unfortunately I already had HTML Purifier set to No.

 

Seems a little complicated editing the cms.tpl

 

Would this make it work? - https://mypresta.eu/modules/administration-tools/tinymce-pro-extended-rich-text-editor.html

Edited by motion2082 (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...