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 01-12-2009 15:43:27

Guest85
Member
Registered: 05-29-2008
Posts: 21

Link category to outside XML link & position search field

Using CCP 6 w/ 006 zipskin. I am needing help with a couple of things:

1. I need a category link on the left navigation bar to direct to an outside XML link that displays our companies projects.

2. I need to move the search field to below or above the Login and Shopping Cart area in the top right. (I tried the CSS but that's not how to do it as it shifts the main contents of the page over.)

Offline

 

#2 01-12-2009 19:02:20

Guest85
Member
Registered: 05-29-2008
Posts: 21

Re: Link category to outside XML link & position search field

3. Would it be possible to use JQuery InnerFade (JavaScript image slideshow that fades in and out) on the splash page? I've tried a few different ways and searched the forums of ways people have used JS but haven't been able to get it to work that way either.

Thanks!

Ty

Offline

 

#3 01-13-2009 12:53:09

Guest85
Member
Registered: 05-29-2008
Posts: 21

Re: Link category to outside XML link & position search field

Bump....Any help on these?

- Ty

Offline

 

#4 01-13-2009 13:03:37

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Link category to outside XML link & position search field

Guest85 wrote:

3. Would it be possible to use JQuery InnerFade (JavaScript image slideshow that fades in and out) on the splash page? I've tried a few different ways and searched the forums of ways people have used JS but haven't been able to get it to work that way either.

Don't know about JQuery InnerFade but the landing page of  uses one of the JS slideshows from DynamicDrive.  The contents were added to the splash web page in CCP.

Offline

 

#5 01-13-2009 13:11:42

Guest85
Member
Registered: 05-29-2008
Posts: 21

Re: Link category to outside XML link & position search field

Thanks for that Dave. I'll see if I can figure it out with the help of that site.

Any ideas 1 and 2 from above?

Thanks again.

- Ty

Offline

 

#6 01-13-2009 13:32:35

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Link category to outside XML link & position search field

With a zip skin I'm afraid not.  The menus are built using femenus.php which resides in the {private}/apps/ccp0/CCP/ext directory (a core file).  The menucategories method in that files is what builds out the data to display the categories so, in theory, you could add a hard link to the array that that method builds.

Offline

 

#7 01-13-2009 17:50:18

Guest85
Member
Registered: 05-29-2008
Posts: 21

Re: Link category to outside XML link & position search field

Dave,

Am I putting the hard coded link in the correct spot in femenus.php? About 15 lines down I used echo my example URL. (A portion of the code in the file is provided below to show where I tried it.) This works but isn't placed in the product categories nav on the side. It is placed right above the product categories nav and without formatting like the product categories. I've also tried adding onto some of the arrays but not sure if I was doing that correct as I haven't used a hyperlink call from within an array before. Trying different ways I could think of resulted in the page being displayed blank after that array and didn't display the product categories.

Thanks a lot for your help...much appreciated!!

-Ty

Code:

// +------------------------------------------------------------------+
// | Function: menucategories                                         |
// +------------------------------------------------------------------+

function menucategories () {

// +--
// | This function prints the categories menu.
// +--

$table = $this->app . '_cat';

$sql  = "SELECT id, name FROM {$table} WHERE splashdisp=";
$sql .= $this->KHXC_DB->quote(1) . " AND ";

echo '<a href="http://www.example.com">Example</a>'; // Hyperlink Pointing to XML Website Outside of CCP

// +--
// | Handle visibility.
// +--

$usergroup = $this->globals('khxc_user.usergroup');

if (empty($usergroup)) {
 
     $sql .= 'catview=' . $this->KHXC_DB->quote('A');

} else {

     $sql .= '((catview=' . $this->KHXC_DB->quote('A') . ') OR ';
     $sql .= '(catview=' . $this->KHXC_DB->quote('L') . ' AND ';
     $sql .= '(catviewg LIKE ' . $this->KHXC_DB->quote_like($usergroup . ',') . ' OR ';
     $sql .= 'catviewg LIKE '  . $this->KHXC_DB->quote_like(','  . $usergroup) . ' OR ';
     $sql .= 'catviewg LIKE '  . $this->KHXC_DB->quote_like(', ' . $usergroup) . ' OR ';
     $sql .= 'catviewg='       . $this->KHXC_DB->quote($usergroup) . ')))';

} // End of if statement.

// +--
// | Execute the query.
// +--

$result = $this->KHXC_DB->sql_do(array('sql'    => $sql,
                                       'table'  => $table,
                                       'order'  => array('sortorder' => 'ASC')));

if ($this->IsError($result)) {return 1;}
if (empty($result))          {return 1;}

// +--
// | Build the menu array.
// +--

$menu_array = array();

foreach ($result as $num => $row) {

     $menu_array[] = array('text'      => $row['name'],
                           'app'       => $this->app,
                           'namespace' => 'catshow',
                           'params'    => array('ref' => $row['id']));

} // End of foreach statement.

// +--
// | Globalize the menu array.
// +--

$this->globals('khxc_app.femenu_array',$menu_array);

// +--
// | Print the generic frontend menu includes and log that we were here.
// +--

$this->KHXC_Display->include_file($this->app,'femenuhead.php');

$this->KHXC_Display->include_file($this->app,'femenugeneric.php');

$this->KHXC_Display->include_file($this->app,'femenufoot.php');

if ($this->debug) {$this->debugger("menupages: Printed the CCP categories menu.  App: {$this->app}");}

// +--
// | Return true.
// +--

return 1;

} // End of function.

Offline

 

#8 01-13-2009 18:02:11

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Link category to outside XML link & position search field

Place it into the includes femenugeneric.php which should be what is formating the display.

John

Offline

 

#9 01-13-2009 18:26:51

Guest85
Member
Registered: 05-29-2008
Posts: 21

Re: Link category to outside XML link & position search field

This displayed my link at the bottom of the navigation section but it shows in all three navigations (Product Categories, Online Store Menu, Important Information).

Code:

$eol              = $this->globals('khxc.eol');
$femenu_array     = $this->globals('khxc_app.femenu_array');

if (!(empty($femenu_array))) {

     print '<ul>' . $eol;

     foreach ($femenu_array as $num => $data) {

          $text = $this->xhtml_encode($data['text']);

          $link = $this->link_namespace($data['app'],$data['namespace'],$data['params']);

          print '     <li><a href="' . $link . '" title="' . $text . '">';
          print $text . '</a></li>' . $eol;

     } // End of foreach statement.

     print '</ul>' . $eol . $eol;

} // End of if statement.
            print '<a href="http://www.example.com">Example</a>'; // Hyperlink Pointing to XML Website Outside of CCP

This displays my hard coded hyperlink above every one of the hyperlinks pulled from the database in the 3 navigation bars.

Code:

$eol              = $this->globals('khxc.eol');
$femenu_array     = $this->globals('khxc_app.femenu_array');

if (!(empty($femenu_array))) {

     print '<ul>' . $eol;

     foreach ($femenu_array as $num => $data) {

          $text = $this->xhtml_encode($data['text']);

          $link = $this->link_namespace($data['app'],$data['namespace'],$data['params']);

          print '     <li><a href="' . $link . '" title="' . $text . '">';
          print $text . '</a></li>' . $eol;
       print '<a href="http://www.example.com">Example</a>'; // Hyperlink Pointing to XML Website Outside of CCP
     } // End of foreach statement.

     print '</ul>' . $eol . $eol;

} // End of if statement.

Offline

 

#10 01-13-2009 19:17:29

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Link category to outside XML link & position search field

You have to add it to the array that's built in the first place I pointed you to Ty.  You can't hard code it as an echo or print.  The array that is built is used later and displayed.

Offline

 

#11 01-15-2009 14:29:31

Guest85
Member
Registered: 05-29-2008
Posts: 21

Re: Link category to outside XML link & position search field

Heya,

Sorry to bother again with another follow up but I can't seem to get the hyperlink to work in the femenus.php file.

Has anyone been able to get this to work on their site and able to provide an example using the array and hyperlink?

Thanks in advance.

Ty

Offline

 

Board footer