1

I want to have a button on the CMS page that calls a controller. The CMS content is:

<p>{{config path="web/secure/base_url"}}cmsmanager/export/params</p>

This line produces the url that , if I copy it and paste into a browser, calls ExportController and the method params as expected so it looks like its configured correctly.

But the next two lines show buttons with the correct label but do not open the link:

<p><input type="button" onclick="window.open({{config path="web/secure/base_url"}}cmsmanager/export/params);" value="Window Open" /></p>

OR

<p><input type="button" onclick="setLocation({{config path="web/secure/base_url"}}cmsmanager/export/params);" value="Set Location" /></p>

2 Answers 2

3

Try onclick="location.href='{{store url="cmsmanager/export/params"}}'".

2
  • Thanks, I missed the single quotes. How does store url differ from the config path="web/secure/base_url ?
    – Dan
    Jan 28, 2014 at 10:42
  • {{sotre ..}} is a shortcut for getUrl(..) where arguments are passed to the method and processed while {{config path ..}} just returns the base URL and then you put the rest of your path afterwards. Jan 28, 2014 at 12:00
0

This will also work.

<p><input onclick="window.location.href='{{store url="cmsmanager/export/params"}}'" type="button" value="Window Open" /></p>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.