• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: Menu based on cssmenu
PostPosted: Fri Apr 17, 2020 3:05 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Wed Mar 11, 2020 6:38 pm
Posts: 16
Hello!

I've customized a Menu from cssmenu. It looks fine in the page and on hover the target shows up in the status bar of the browser. But when I click a link nothing happens. Other links out of the menu are working. Here is the code:

\$1:
{* Ormed Menu *}
{* this template uses recursion, but not a smarty function. *}
{*
  variables:
  node: contains the current node.
  aclass: is used to build a string containing class names given to the a tag if one is used
  liclass: is used to build a string containing class names given to the li tag.
*}
{if !isset($depth)}{$depth=0}{/if}
{strip}

{if $depth == 0}
    <nav class="nav-menu d-none d-lg-block">
    <!--main-nav-start-->
   <ul class="nav-inner">
   {else}
    <ul>
{/if}

{$depth=$depth+1}
{foreach $nodes as $node}
  {* setup classes for the anchor and list item *}
  {$liclass=[]}
  {$aclass=[]}

  {* the first child gets a special class *}
  {*if $node@first && $node@total > 1}{$liclass[]='first_child'}{/if*}

  {* the last child gets a special class *}
  {*if $node@last && $node@total > 1}{$liclass[]='last_child'}{/if*}

  {if $node->current}
    {* this is the current page *}
    {*$liclass[]="menuactive active"*}
    {$liclass[]="active"}
    {*$aclass[]="menuactive"*}
  {/if}
  {if $node->has_children}
    {* this is a parent page *}
    {*$liclass[]="menuparent drop-down"*}
    {$liclass[]="drop-down"}
    {*$aclass[]="menuparent"*}
  {/if}

  {if $depth == 1 && $node@iteration == 5}
    <li class="nav-logo">
      <a href="https://ordemdosmedicos.co.ao">
        <img src="{uploads_url}/images/logo.svg" alt="Ordem dos Médicos de Angola" width="55px" alt="" class="img-fluid" />
      </a>
    </li>{*else*}{*$node->menutext*}
  {/if}

  {* build the menu item from the node *}
  {if $node->type == 'sectionheader'}
    <li class='{implode(' ',$liclass)}'><a{if count($aclass) > 0} class="{implode(' ',$aclass)}"{/if}><span class="sectionheader">{$node->menutext}</span></a>
      {if isset($node->children)}
        {include file=$smarty.template nodes=$node->children}
      {/if}
    </li>
  {else if $node->type == 'separator'}
    <li style="list-style-type: none;"><hr class="menu_separator"/></li>
  {else}
    {* regular item *}
    <li class="{implode(' ',$liclass)}">
      <a{if count($aclass) > 0} class="{implode(' ',$aclass)}"{/if} href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}><span>{$node->menutext}</span></a>
      {if isset($node->children)}
        {include file=$smarty.template nodes=$node->children}
      {/if}
    </li>
  {/if}
{/foreach}
{$depth=$depth-1}
</ul>

{if $depth == 0}

</nav><!--main-nav-end-->
{/if}
{/strip}


Thank you


Last edited by velden on Fri Apr 17, 2020 6:35 pm, edited 1 time in total.
added code tags


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Menu based on cssmenu
PostPosted: Fri Apr 17, 2020 11:20 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Wed Mar 11, 2020 6:38 pm
Posts: 16
Here's my system information:

----------------------------------------------

Cms Version: 2.2.14

Installed Modules:

AdminSearch: 1.0.5
CGExtensions: 1.65.2
CMSContentManager: 1.1.9
CmsJobManager: 0.1.3
DesignManager: 1.1.8
Disqus: 2.1.3
FileManager: 1.6.11
FilePicker: 1.0.4.1
Gallery: 2.4.2
MicroTiny: 2.2.4
ModuleManager: 2.1.7
Navigator: 1.0.9
News: 2.51.9
PDFGenerator: 1.0
Search: 1.51.8

Config Information:

php_memory_limit:
max_upload_size: 16000000
url_rewriting: none
page_extension:
query_var: page
auto_alias_content: true
locale:
set_names: true
timezone: Africa/Luanda
permissive_smarty: false

Php Information:

phpversion: 7.3.16
md5_function: On (Verdadeiro)
json_function: On (Verdadeiro)
gd_version: 2
tempnam_function: On (Verdadeiro)
magic_quotes_runtime: Off (Falso)
E_ALL: 32759
E_STRICT: 2048
E_DEPRECATED: 8192
test_file_timedifference: No time difference found
test_db_timedifference: No time difference found
create_dir_and_file: 1
memory_limit: 128M
max_execution_time: 180
register_globals: Off (Falso)
output_buffering: On
disable_functions: exec, passthru, shell_exec, system
open_basedir:
test_remote_url: Sucesso
file_uploads: On (Verdadeiro)
post_max_size: 16M
upload_max_filesize: 16M
session_save_path: /var/cpanel/php/sessions/ea-php73 (1733)
session_use_cookies: On (Verdadeiro)
xml_function: On (Verdadeiro)
xmlreader_class: On (Verdadeiro)
check_ini_set: On (Verdadeiro)
curl: On

Performance Information:

allow_browser_cache: On (Verdadeiro)
browser_cache_expiry: 60
php_opcache: Off (Falso)
smarty_cache: Off (Falso)
smarty_compilecheck: On (Verdadeiro)
auto_clear_cache_age: On (Verdadeiro)
Server Information:

Server Software: Apache
Server Api: fpm-fcgi
Server Os: Linux 3.10.0-1062.4.3.el7.x86_64 On x86_64
Server Db Type: MySQL (mysqli)
Server Db Version: 10.3.22
Server Db Grants: Encontrada uma declaração "GRANT ALL" que parece ser adequada

Permission Information:

tmp: /home/ormedao/public_html/tmp (0755)
tmp_cache: /home/ormedao/public_html/tmp/cache (0755)
templates_c: /home/ormedao/public_html/tmp/templates_c (0755)
modules: /home/ormedao/public_html/modules (0755)
uploads: /home/ormedao/public_html/uploads (0755)
Mascara de Criação de Ficheiros (umask): /home/ormedao/public_html/tmp/cache (0755)
config_file: 0444
----------------------------------------------


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Menu based on cssmenu
PostPosted: Fri Apr 17, 2020 6:20 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 985
Location: Victoria, BC
Check that your html validates, and that there's nothing in the error console (F12).

Failing that, supply us with a link where we can see the page (not) working.

_________________
Not getting the answer you need? CMSMS support options


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Menu based on cssmenu
PostPosted: Sat Apr 18, 2020 9:34 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Wed Mar 11, 2020 6:38 pm
Posts: 16
Here's a link:

https://ordemdosmedicos.co.ao/index.php?page=regulamenta%C3%A7%C3%A3o


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Menu based on cssmenu
PostPosted: Sat Apr 18, 2020 12:04 pm 
Offline
Dev Team Member
Dev Team Member

Joined: Mon Nov 28, 2011 9:29 am
Posts: 3233
Location: The Netherlands
I suspect your javascript to interfere with the links.

https://ordemdosmedicos.co.ao/uploads/ormed/js/main.js


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Menu based on cssmenu  Topic is solved
PostPosted: Sat Apr 18, 2020 2:16 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 985
Location: Victoria, BC
Velden is correct - putting preventDefault() on links does exactly that - prevents the default action. You'll need to make it more specific to section headers or something.

_________________
Not getting the answer you need? CMSMS support options


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Menu based on cssmenu
PostPosted: Sat Apr 18, 2020 4:12 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Wed Mar 11, 2020 6:38 pm
Posts: 16
Gotit Guys...

I need the preventDefault function for a few pages. Simply created another js without that funcion

Problem solved!

Thanks a lot!


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Hosting Nation - Managed CMSMS Hosting