Need Popup Window On Vendor Home Page Block

I am using a "pages block" on the vendors store layout page so that vendors can create pages and they show up in the block. I don't like how the pages open in a new window and take customers away from the vendors home page. I would like to be able to make these pages or forms open in a popup window. What template do I need to modify? I probably need to use this class somewhere in the template (class="cm-dialog-opener cm-dialog-auto-size"). Here are a few screen shots of what I am looking at achieving. Thanks for the help.



Generally pop ups in cs-cart are done via the fn_set_notification() PHP function using the 'N' type.

Using this approach, you'd just use standard html for the content of the message and would format appropriately).

To use the fn_set_notification for this, you'd probably want to have it be conditional upon different conditions from the runtime environment like: controller/mode and company_id. I.e.

if( Registry::get('runtime.company_id') == 3) { // add content for company_id 3
  fn_set_notification('N', '',[some code or file reference for company_id 3]", 'K');

Depending on your usage, you would add to the conditions as your business needs require.

You should use the common/popupbox.tpl template and specify link to the vendor pages as a href parameter

Could you explain in a little more detail? Thank you.

the code should be similar to this one:

{include file="common/popupbox.tpl" link_text="name" href="pages.view?page_id=2`" id="2" text='test' content=''}

Ok. The block info is automatically added from each vendor when they add pages using the filing "vendor". So this info needs to be dynamically added to the block on each vendors home page. Should this info be added to templates/blocks/pages/pages_text_links.tpl? Thank for the help.

You are right. Try to replace:



{include file="common/popupbox.tpl" link_text=$ href=$href id=$page.page_id text=$ content=''}

Then clear the cache

(!) Not tested

That works great. Only issue is the width of the popup is only as wide as the page title. I wish it was the default width for popups? It also does not automatically fit in the widow width on smaller devices like it should.


In this case, please use the content of the popupbox.tpl template, but remove the cm-dialog-auto-size class from it