How do I now go about creating a log-in page? Is it the ‘Show as Trade log-in’ under the hood?

Under the hood I wouldn't play with Display Menu Options where you found Show as Trade log-in - please leave it as default. It's a bit more complicated concept that allows you to display different navigation based on active account type. What you are looking for is the Require Login (force login) checkbox. Please select this is you want a page to be available only to registered customers.


 

I’m keen to use the ‘Search’ function in the near future. If I enable it, will it scan text for appropriate words or will it check metatags? Not sure how best to make it effective as possible.

Search functionality implemented in Onxshop is using fully featured full text search Zend_Search_Lucene and analysing document by it's type, so when it's HTML in our case, it looks into the body text and also meta tags. The results are sorted by their rank, basically by number of keywords found in each document.

Does that mean, for instance, that keywords in <title> and <h1> elements are weighted more heavily in the search algo than keywords in <p> elements?

Yes, that's correct. It full text search with understanding of HTML structure.

http://framework.zend.com/manual/en/zend.search.lucene.overview.html

Zend_Search_Lucene_Document_Html class recognizes document title, body and document header meta tags.

 

How easy is it to completely remove the login part of the checkout process, so to have a checkout process with no need to register/log in

The login for checkout process is not essential, you can create checkout with anonymous user (ID=0). However in reality you almost certainly need to take customer's name, email and postal/invoice address anyway, so you can create a user ID for that email in the backend for accounting purposes. It would be an account without password, so the customer cannot login. Subscribe to newsletter works in a similar way. It creates customer ID and if the customer is creating a real account later, it only updates his details.

Your Onxshop supplier is able to customise the checkout process per your request, e.g. Laposa's current standard rate is £600 for creating customised checkout pages including payment gateway setup of your choice.

Is it possible to allow some users only limited access?

You can limit pretty much anything, using Access Control List (ACL) and defining a workflow. I.e. you can allow your public visitors to submit an article, then senior member can review it and approve for publishing.

I've installed Onxshop on my default domain, but it shows only It Works

If you have your domain name the same as the homepage, you need to disable Debian Apache default site.

$ a2dissite default && /etc/init.d/apache2 restart

Hello World

Create template file:

templates/component/hello_world.html
<!-- BEGIN: content -->
This is output: {RESULT}
<!-- END: content -->

Create associated controller file:

controllers/component/jhello_world.php
<?php

class Onxshop_Controller_Component_Hello_World extends Onxshop_Controller {

/**
 * main action
 */

public function mainAction() {

$text = "Hello World!";

$this->tpl->assign("RESULT", $text);
return true;

}
}

Use in CMS

Insert into CMS as Generic Component content element.

I made changes, they are visible in edit and preview mode, but not when open URL in a different browser

You need to clear the page cache, which is the lightning icon in the top bar. Every page in Onxshop is fully cached and it can be stored for up to 24 hours. If you want to make you changes visible to everyone immediately, than click on this icon. It's a good practise to clean cache at the end of your editing session, not after each single update.

Can I have a different title in navigation, page and search engine listing?

Yes, absolutely. You can customise the title as you wish.

  • Navigation title is for menu item and it’s the only one mandatory.
  • Heading title is the title you’ll see at the top of the page and is optional, if not provided navigation title is used instead. This is to allow you to have a short navigation label, but more comprehensive page title, for example “About” as short navigation title “About Us” as heading (page) title.
  • Browser title is for the browser window and also search engine listing. If not provided it will look first into re-using the heading title and if it’s empty, it will use the navigation title.
  • Title for URL is for the URL generation, if not provided navigation title is used.

Can I create multiple blog sections on one domain?

Yes, but it needs to be done in the database. For example if you want to create a blog section under node ID 1234, you will need to add this to common_configuration table:

node_id= 1234, object = 'common_node', property = 'id_map-blog', value = '1234'

How can I modify primary navigation?

Go to templates/node/side/default.html and replace {PRIMARY_NAVIGATION} with your customised code. For example you can call the menu component with options to show all items (expand_all=1), which is useful for creating dropdowns.

The code would be: 
{ONXSHOP_REQUEST_menu #component/menu~level=3:expand_all=1:display_teaser=0:id=1:open=GET.id~}

Where parameter "id" is your root folder ID (ID 1 = Primary Navigation container)

What's the best way of referring to the current and parent page ID and URL

In templates:

  • {PAGE_ID}
  • {PARENT_PAGE_ID}

In controllers:

  • $this->page_id
  • $this->parent_page_id

Try also {_SESSION.active_pages|print_r(%s, true)} for example page ID for two levels up would be {_SESSION.active_pages.2}

Can you provide a list of parameters available to each Onxshop component and details of their function?

Each parameter is listed within the component source code, for example: take component/menu_stack.php (https://github.com/laposa/onxshop/blob/master/controllers/component/menu_stack.php) you will see that there are three parameters: 

$image_width = $this->GET['image_width'];
$image_height = $this->GET['image_height'];
$image_fill = $this->GET['image_fill'];

And because it is inheriting component/menu.php you can also use: 

// how deep we can go, zero means unlimited
if (isset($this->GET['level'])) $max_display_level = $this->GET['level'];
else $max_display_level = 0;

// if to expand all items, when 1 show all (ie for sitemap), 0 expands only active items
if ($this->GET['expand_all'] == 1) $expand_all = 1;
else $expand_all = 0;

// 1 parse strapline
if ($this->GET['display_strapline'] == 1) $display_strapline = 1;
else $display_strapline = 0;

// 1 shows only published items, 0 shows all
// possible security flaw, user can see list of not published items if provide the get parameter
if (is_numeric($this->GET['publish'])) $publish = $this->GET['publish'];
else $publish = 1;

// open this item (active item)
if (is_numeric($this->GET['open'])) $open = $this->GET['open'];
else $open = null;

// node_id
if (is_numeric($this->GET['id'])) $node_id = $this->GET['id'];
else $node_id = null; //null if not provided (it's correct value for tree's root elements)

// filter (see common_node->prepareNodeGroupFilter() for available filters)
if (isset($this->GET['filter'])) {

$filter = $this->GET['filter'];

} else {

if (ONXSHOP_ECOMMERCE === true) $filter = 'page_exclude_products_recipes'; // don't show products in navigation on ecommerce sites as could have large product database
else $filter = 'page';

}

How can I extend existing controller

For example controllers/component/survey.php

Extend keeping the same filename

Create new file in your project folder.

>?php
/** 
 * Copyright (c) 2018 Laposa Limited (https://laposa.ie)
 * Licensed under the New BSD License. See the file LICENSE.txt for details.
 * 
 */

require_once ONXSHOP_DIR . 'controllers/component/survey.php';

class Onxshop_Controller_Component_Survey_Local extends Onxshop_Controller_Component_Survey {

    /**
     * main action
     */
     
    public function mainAction() {
        
        return parent::mainAction();

    }
}
  

How to find what data are available in template

You can use PHP print_r function as Xtemplate callback function, for example:

{ITEM|print_r(%s, true)}

Ask another question

Contact form