You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Pages: 1
A newbie to K9 and ecommerce shop software.
I’m trying to add a new skin widget to the NavBar for displaying informational HTML pages (eg. a guide to how to select the correct part, despatch options, FAQ’s etc).
I have created one HTML guide by cloning a webpage from the Main Menu and adding my own HTML. This works very well, but the guide is showing up under the Main Menu.
So, I have followed this forum thread (see post No.2)
https://forum.kryptronic.com/viewtopic.php?id=34116
…. and I have created a new Skin Widget (by cloning the Main Menu skin widget).
The new widget is being displayed on the NavBar, but I seem to be missing a step or two.
How do I associate or create these informational web pages with the new skin widget?
I have left the Icon class as Main Menu (I'm unable to find a new class listed) and this widget is in a custom skin directory.
The online store is installed under a sub directory of Webspace.
If anybody can assist, please reply in a manner that a newbie can understand
I am familiar with FileZilla and Notepad++
Thanks….
Last edited by Murphys001 (12-20-2021 16:31:38)
Offline
Using System / Displays / Skin Widgets, edit the skin widget you created. In it's Skin Widget Display Code, you'll see a reference to an include. Give that include a new name. If you cloned the Main Menu widget and didn't change the include reference, it will look like this:
<?php return $this->include_file('cms','skinwidget_pages.php'); ?>
Change to:
<?php return $this->include_file('cms','skinwidget_infopages.php'); ?>
Next, using FTP, get a local copy of the file {private}/apps/cms/CMS/includes/skinwidget_pages.php, rename it to skinwidget_infopages.php, and upload it to {private}/apps/cms/CMS/includes. Modify the code in the file so it pulls the menu items you want.
Offline
Ok....
Followed the new method and I now have a skin widget on the NavBar with an identical list of menu options as per the original Main Menu, including the previously created "Info Page".
Re: Modify the code in the file so it pulls the menu items you want.
Any clues as to what needs to be amended so I can display just the "Info Page" and not the other Main Menu items?
Btw.... I have left the Icon class for this new Skin Widget as "Main Menu" as I'm unable to find a new class listed for this newly created Skin Widget.
Last edited by Murphys001 (04-09-2021 11:24:20)
Offline
To pull just that one page, assuming it's id is 'InfoPage', right above:
$result = $CORE_DB->sql_do(array('sql' => $sql, 'table' => 'cms_html', 'order' => array('menuorder' => 'ASC')));
Add:
$sql .= ' AND id=' . $CORE_DB->quote('InfoPage');
You can use any class you like for the widget - just select one from the choices presented.
Offline
Thanks that worked.....
How would I now remove or prevent the same "InfoPage" being listed in the Main menu, leaving the normal "Home", "Store Policies" etc... still visible?
The "InfoPage" was first created by cloning another webpage from Dashboard / Website / Content / Webpages
Presumably there is a mod need to the original skinwidget_pages.php file.
Last edited by Murphys001 (04-12-2021 11:49:37)
Offline
Presumably there is a mod need to the original skinwidget_pages.php file.
Correct. Basically the exact same edit, but use this for your SQL instead:
$sql .= ' AND id<>' . $CORE_DB->quote('InfoPage');
Note the = (equal to) became <> (not equal to).
Offline
Great....
That "not equals" mod works very well in the original skinwidget_pages.php file for just one specific "InfoPage".
However, I intend to create about eight HTML "InfoPages" web pages (using the same method of cloning a webpage from Dashboard / Website / Content / Webpages) and adding each web page to the newly created "Information" Skin Widget on the NavBar.
How could the command $sql .= ' AND id<>' . $CORE_DB->quote('InfoPage');
be modified in the original skinwidget_pages.php file to exclude a range of these eight InfoPages from being displayed under the "Main Menu" Skin Widget?
I could use Identifiers named:-
InfoPage1, InfoPage2, InfoPage3 ........ InfoPage7, InfoPage8.
So they all have a comman name structure.
Thanks and I hope this forum post is of benefit to other new users....
Offline
$sql .= ' AND id<>' . $CORE_DB->quote('InfoPage'); $sql .= ' AND id<>' . $CORE_DB->quote('InfoPage2'); $sql .= ' AND id<>' . $CORE_DB->quote('InfoPage3'); $sql .= ' AND id<>' . $CORE_DB->quote('InfoPage4'); $sql .= ' AND id<>' . $CORE_DB->quote('InfoPage5'); $sql .= ' AND id<>' . $CORE_DB->quote('InfoPage6');
Offline
Pages: 1