Kryptronic Software Support Forum

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.

#1 04-09-2021 04:38:41

Murphys001
Member
Registered: 09-06-2014
Posts: 18

Adding a new Skin Widget to NavBar for additional HTML Webpages

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=34523
…. 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 (04-09-2021 05:00:27)

Offline

 

#2 04-09-2021 07:47:13

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19717
Website

Re: Adding a new Skin Widget to NavBar for additional HTML Webpages

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:

Code:

<?php return $this->include_file('cms','skinwidget_pages.php'); ?>

Change to:

Code:

<?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.


Nick Hendler

Offline

 

#3 04-09-2021 11:19:08

Murphys001
Member
Registered: 09-06-2014
Posts: 18

Re: Adding a new Skin Widget to NavBar for additional HTML Webpages

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

 

#4 04-12-2021 07:47:08

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19717
Website

Re: Adding a new Skin Widget to NavBar for additional HTML Webpages

To pull just that one page, assuming it's id is 'InfoPage', right above:

Code:

$result = $CORE_DB->sql_do(array('sql' => $sql, 'table' => 'cms_html', 'order'  => array('menuorder' => 'ASC')));

Add:

Code:

$sql .= ' AND id=' . $CORE_DB->quote('InfoPage');

You can use any class you like for the widget - just select one from the choices presented.


Nick Hendler

Offline

 

#5 04-12-2021 11:44:51

Murphys001
Member
Registered: 09-06-2014
Posts: 18

Re: Adding a new Skin Widget to NavBar for additional HTML Webpages

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

 

#6 04-13-2021 11:16:17

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19717
Website

Re: Adding a new Skin Widget to NavBar for additional HTML Webpages

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:

Code:

$sql .= ' AND id<>' . $CORE_DB->quote('InfoPage');

Note the = (equal to) became <> (not equal to).


Nick Hendler

Offline

 

#7 04-14-2021 00:14:56

Murphys001
Member
Registered: 09-06-2014
Posts: 18

Re: Adding a new Skin Widget to NavBar for additional HTML Webpages

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

 

#8 04-14-2021 07:51:53

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19717
Website

Re: Adding a new Skin Widget to NavBar for additional HTML Webpages

Code:

$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');

Nick Hendler

Offline

 

Board footer