Artisteer Advanced FAQ

Joomla

How to create two horizontal menus
How to change Single Article title from H2 to H1

Wordpress

How to create new Widget Area
How to create two horizontal menus

Joomla

How to create two horizontal menus

Artisteer creates one horizontal menu and places it in “user3” (“position-1”) position according to the scheme of positions provided for Artisteer themes. This instruction describes steps to create an extra area for a second horizontal menu which will use the same styling as the first one.

Please note that the workaround was created for Artisteer 4.2 templates. There can be some minor changes for templates created in earlier/later versions of Artisteer.

To create a second horizontal menu for Artisteer themes please follow these steps:

  1. Open your index.php file and find the block like this:
    <nav class="art-nav">
    <div class="art-nav-inner">
    <?php if ($view->containsModules('extra1')) : ?>
    <div class="art-hmenu-extra1"><?php echo $view->position('extra1'); ?></div>
    <?php endif; ?>
    <?php if ($view->containsModules('extra2')) : ?>
    <div class="art-hmenu-extra2"><?php echo $view->position('extra2'); ?></div>
    <?php endif; ?>
    <?php echo $view->position('user3'); ?>
    </div>
    </nav>
    

    Right after the block insert this one:

    <nav class="art-nav">
    <div class="art-nav-inner">
    <?php echo $view->position('test'); ?>
    </div>
    </nav>
    

    “Test” is a name of the position responsible for the second horizontal menu.

    Note: In fact you can add the second horizontal menu block elsewhere on the page.

  2. Go to the folder html/mod_menu of your template folder and open the default.php file.

    Find "user3" (or "position-1") using Ctrl+F and right after "user3" add a new condition:

    || $attribs['name'] == 'test'
    

    So the whole "if" condition will look like:

    if (isset($attribs['name']) && $attribs['name'] == 'user3' || $attribs['name'] == 'test') {
    
  3. Open your templateDetails.xml file and add the following position to the list of positions:
    <position>test</position>
    

    Make sure you have saved all the modified files.

    Now you can add a new menu in the "test" position in Module Manager. It will be placed right under the first horizontal menu.


    How to change Single Article title from H2 to H1

    By default Artisteer exports page Headline as H1. But what if you're using an image instead of the Header Headline or there is no Header at all?

    In this case it's better to change the Single Article title from H2 to H1 for better SEO.

    Here are the steps you need to follow:

      1. Go to the templates\[template_name]\finctions.pp file and find the article wrapper function:
        function artxPost($data)
        {
        if (is_string($data))
        $data = array('content' => $data);
        .....
        .....
        return artxFragmentEnd("</article>", '', true);
        }
        
      2. Duplicate this wrapper function below/
      3. Rename the function to, let's say, "artxPost2":
        function artxPost2($data)
        {
        if (is_string($data))
        $data = array('content' => $data);
        .....
        
      4. Change the article headline tag inside the new wrapper function:
         artxFragmentBegin("<h2 class=\"art-postheader\">");
                    if (isset($data['header-text']) && strlen($data['header-text'])) {
                        if (isset($data['header-link']) && strlen($data['header-link']))
                            artxFragmentContent('<a href="' . 
        $data['header-link'] . '">' . $data['header-text'] . '</a>'); else artxFragmentContent($data['header-text']); } artxFragmentEnd("</h2>");

        should be:

         artxFragmentBegin("<h1 class=\"art-postheader\">");
                    if (isset($data['header-text']) && strlen($data['header-text'])) {
                        if (isset($data['header-link']) && strlen($data['header-link']))
                            artxFragmentContent('<a href="' . 
        $data['header-link'] . '">' . $data['header-text'] . '</a>'); else artxFragmentContent($data['header-text']); } artxFragmentEnd("</h1>");
    1. Open [template_name]\library\Artx\Content\SingleArticle.php and add new function:
      public function article($article)
      {
      return artxPost2($article);
      }
      

      to the end of the file before the last closing bracket.

    Now all Single Article titles are H1.

    Note: This solution does not affect the article titles on the blog layout pages (Category Blog Layout, featured Articles Layout).


    Wordpress

    How to create new Widget Area

    Please see a scheme of predefined WordPress widget areas here.

    Let's imagine you need to create a new widget area for your WordPress template which will be placed right under the horizontal menu. Here are the steps you need to follow:

    1. Go to your template folder and create a sidebar-test.php file containing the following line:
      <?php theme_print_sidebar('test-area', '<div class="art-test clearfix">', '</div>'); ?>
      
    2. Open your header.php file, find this string:
      <div class="art-layout-wrapper">
      

      and right before it, insert this line:

      <?php get_sidebar('test'); ?>
      
    3. Go to the /library folder, open the sidebars.php file and add the following code:
      theme_add_sidebar('test', 'test-area', __('Test Widget Area', THEME_NS), __("This 
      sidebar is displayed after the horizontal menu.", THEME_NS));

      The code should be added to other “theme_add_sidebar” blocks, for instance, you can add it after this block:

      theme_add_sidebar('nav', 'second-nav-widget-area', __('Second Navigation Widget Area', 
      THEME_NS), __("This sidebar is displayed after the horizontal menu.", THEME_NS));

    Make sure you have saved all the modified files.

    Now, if you go to Appearance >> Widgets from your WordPress Back-End, you will find a new "Test" widget area.

    How to create two horizontal menus

    Artisteer creates only one horizontal menu which is Primary Navigation in WordPress.

    This instruction describes steps to create a second horizontal menu which will use the same styling as the first one.

    Here are the steps you need to follow:

    1. Go to the [theme_name]\header.php or [theme_name]\sidebar-header.php file.

      Note: In general you can add the second menu to any other sidebar template.

    2. Add the second Primary Navigation to the place you want it to appear:
      <?php if (theme_get_option('theme_use_deafult_menu')) { wp_nav_menu( 
      array('theme_location' => 'primary2-menu') );} else { ?><nav class="art-nav nav2"> <?php echo theme_get_menu(array( 'source' => theme_get_option('theme_second_menu_source'), 'depth' => theme_get_option('theme_menu_depth'), 'menu' => 'primary2-menu', 'class' => 'art-hmenu menu2' ) ); get_sidebar('nav'); ?> </nav><?php } ?>
    3. Open [theme_name]\functions.php and find the first Primary Navigation registration:
      register_nav_menus(array('primary-menu' => __('Primary Navigation', THEME_NS)));
      

      and add the following line below to register second Primary navigation:

      register_nav_menus(array('primary2-menu' => __('Second Primary Navigation', THEME_NS)));
      

      Now you can assign Custom menu to the new Primary Navigation (WP -> Appearance -> Menus):

      second primary navigation
    4. In case you want to use one of the default menu sources (Pages or Categories) please open [theme_name]\library\options.php file and find the following code:
      array(
      		'id'      => 'theme_menu_source',
      		'name'    => __('Default menu source', THEME_NS),
      		'type'    => 'select',
      		'options' => $theme_menu_source_options,
      		'desc'    => __('Displayed when Appearance > Menu > 
      Primary menu is not set', THEME_NS), ),

      them add the following code below:

      array(
      		'id'      => 'theme_second_menu_source',
      		'name'    => __('Default second menu source', THEME_NS),
      		'type'    => 'select',
      		'options' => $theme_menu_source_options,
      		'desc'    => __('Displayed when Appearance > Menu > 
      Second Primary menu is not set', THEME_NS), )

      This will add new option to the WP -> Appearance -> Theme Options -> Navigation Menu -> "Default second menu source".

      Note: You should save the Theme Options in order to apply default source to the new menu.

    Now you have two independent horizontal menus.

    Note: Since the second menu will use the same styling as the first one it could be wrong positioned if the first menu is located inside the Header. In this case you can use the second menu specific class to change its positioning in the [template_name]\style.css file manually:

    .nav2
    {
    position: relative;
    }