HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Drop down menu

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#54563 (In Topic #11896)
Avatar

Community saint

Well it looks like I reverted back to 4.1 a little prematurely eh. RC3 is out, right on! Oh well I am still learning and decided I should learn how to work with the stable version before jumping into the bleeding edge :lol: Looking forward to upgrading when 4.2 stable comes out.

So anyways, here is what I am up too. I am well on my way to having my first theme created for the first site in my multi-site network. ( spyderhoe.ca ) I would like to make the top menu a drop down menu but I don't know how. Could someone steer me in the right direction please?
Back to the top
 
Posted
Rating:
#54564
Avatar

HEADER.tpl, change type=zone to type=dropdown.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#54574
Avatar

Community saint

Thanks for the reply Chris.

I followed Allen's video tutorial (most excellent! Thanks Allen) to create my theme and started with the ocPortal reset theme….there is no type=zone in the HEADER.tpl

HEADER.tpl

Code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!--
Powered by {$BRAND_NAME*}
{VERSION_NUMBER*} version
Copyright ocProducts Limited
{$BRAND_BASE_URL*}
-->

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$LANG*}" lang="{$LANG*}" dir="{!dir}">
<head>
<title>{+START,IF_NON_EMPTY,{HEADER_TEXT}}{HEADER_TEXT*} &ndash; {+END}{$SITE_NAME*}</title>
<meta name="description" content="{DESCRIPTION*}" />
<meta name="keywords" content="{KEYWORDS*}" />
<meta name="copyright" content="{$COPYRIGHT`}" />
<meta name="author" content="{$SITE_NAME*}" />
<meta name="self_url" content="{SELF_URL*}" />

<meta http-equiv="Content-Type" content="application/xhtml+xml; charset={CHARSET}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="GENERATOR" content="{$BRAND_NAME*}" />

{REFRESH}

{+START,IF,{$DEV_MODE}}<base href="http://example.com/" /><!-- Totally break relative URLs so we know if they're used - we shouldn't ever use them, as they reflect path assumptions -->{+END}

<link rel="icon" href="{$BASE_URL*}/favicon.ico" type="image/x-icon" />
{+START,IF,{$HAS_SPECIFIC_PERMISSION,see_software_docs}}{+START,IF_NON_EMPTY,{$SHIFT_DECODE,DOCUMENT_HELP}}<link rel="help" href="{$SHIFT_DECODE,DOCUMENT_HELP}" />{+END}{+END}
{+START,IF,{$EQ,{$ZONE},docs}}
<link rel="search" type="application/opensearchdescription+xml" title="{$SITE_NAME*} {$ZONE*}" href="{$FIND_SCRIPT*,opensearch}?filter=:id=comcode_pages:search_under=docs" />
{+END}

{$,Preload all the panels so that the CSS and JS is known for them}
{$SET,panel_top,{$LOAD_PANEL,top}}
{$SET,panel_left,{$LOAD_PANEL,left}}
{$SET,panel_right,{$LOAD_PANEL,right}}

{$CSS_TEMPCODE}

{+START,IF_PASSED,EXTRA_HEAD}
{EXTRA_HEAD}
{+END}

{$SET,show_top,{SHOW_TOP}}


<script type="text/javascript">// <![CDATA[
{+START,IF,{$AND,{$NOT,{$_GET,keep_has_js}},{$NOT,{$HAS_JS}}}}
if ((document.referrer!='undefined') && (document.referrer.indexOf(window.location.hostname)==-1) && (window.location.href.indexOf('upgrader.php')==-1) && (window.location.search.indexOf('keep_has_js')==-1)) {$,We detect we came from an external source to our site so have not had a chance to detect JS yet. Redirect with JS on, and then hopefully we can remove keep_has_js after one click. This code only happens if JS is marked off, no infinite loops can happen.}
window.location=window.location.href+((window.location.search=='')?(((window.location.href.indexOf('.htm')==-1)&&(window.location.href.indexOf('.php')==-1))?(((window.location.href.substr(window.location.href.length-1)!='/')?'/':'')+'index.php?'):'?'):'&')+'keep_has_js=1{+START,IF,{$DEV_MODE}}&keep_devtest=1{+END}';
{+END}
{+START,IF,{$NOT,{$BROWSER_MATCHES,ie}}}{+START,IF,{$HAS_SPECIFIC_PERMISSION,sees_javascript_error_alerts}}window.take_errors=true;{+END}{+END}
var server_timestamp={$FROM_TIMESTAMP%},ocp_lang='{$LANG;}';
//]]></script>
{$JS_TEMPCODE}
</head>

<body class="re_body" onload="scriptLoadStuff()">


{+START,IF,{$GET,show_top}}
{$SET,PREVIOUS_ZONE,_false}
{+END}


{+START,IF_PASSED,DEFERRED_ERRORS}
<div class="recoverable_errors">
{+START,BOX,{!RECOVERABLE_ERRORS},,light}
{+START,LOOP,DEFERRED_ERRORS}
<p>{_loop_var*}</p>
{+END}
{+END}
</div>
{+END}
Top of my GLOBAL.tpl where my links are located

Code

{$,Make sure the system knows we haven't rendered our primary title for this output yet}
{$SET,done_first_title,_false}
<div id="siteBox">
<div id="header">
<img style="float: left;" alt="corner" src="{$IMG,corner_tl}"/>
<span class="title">
Spyder Hoe Contracting
<span class="subTitle"> Nanaimo Excavating and Landscaping </span>
</span>
<a class="lastMenuItem" title="contact" href="http://spyderhoe.ca">
contact
<span class="desc">send a msg</span>
</a>
<a title="forum" href="http://spyderhoe.ca/forum/index.php?page=forumview&type=misc">
forum
<span class="desc">guest are welcome</span>
</a>
<a title="services" href="http://spyderhoe.ca">
services
<span class="desc">free quotes</span>
</a>
<a title="gallery" href="http://spyderhoe.ca/site/index.php?page=galleries">
gallery
<span class="desc">pictures</span>
</a>
<a title="home" href="http://spyderhoe.ca">
home
<span class="desc">welcome</span>
</a>
</div>
Back to the top
 
Posted
Rating:
#54575
Avatar

Ah, well look in the original HEADER.tpl, find the {$BLOCK,block=side_stored_menu...} bit, copy and paste it into the template you want, and then change type=zone to type=dropdown on it.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#54599
Avatar

Community saint

Right on, that was a big help. For some reason I never thought to use that block. I had a custom menu :$ Much better with ocPortals own menu.

But when I change it to a drop down menu it acts really strange. The menu background turns white and the the menu gets scrambled until you mouse over it then it lines up but does not really work. I'm guessing it's something in the CSS but I am having a hard time pinpointing it. It does the same on my main site when I try to change it as well and on it I have not messed with any of the templates, just used the theme wizard.
Back to the top
 
Posted
Rating:
#54604
Avatar

Community saint

Getting closer. In CSS menu_dropdown_wrap I deleted the line for background color and that fixed the white background in the menu.
Back to the top
 
Posted
Rating:
#54606
Avatar

Community saint

Ok, I think I figured out what is causing the problem but need help with a solution.

When I add a branch that is what scrambles it. Eg. I tried adding a link under 'Home'. When the page loads all the links are out of line until you mouse over home and then they line up….have a peak at spyderhoe.ca please to see.
Back to the top
 
Posted
Rating:
#54607
Avatar

Community saint

Experimenting with this ocPortal.com - ocPortal Tutorial: Customising what's on the menus in the tutorials now. Not having much luck though….yet.
Back to the top
 
Posted
Rating:
#54611
Avatar

Community saint

Cannot wait to see your finished theme, Brian. You seem to be matching what you showed me via Facebook pretty close.  :thumbs:

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#54613
Avatar

Community saint

It's coming together eh!  :thumbs: I really like it. Getting a little frustrated trying to figure out the dropdown menu though.

This is what I started with Open Source Web Design - Preview - reflection

I want to make a whole bunch of themes. It think that would go a long ways towards attracting people into my network if all the sites don't have to look the same….and yes I will of course be sharing my themes  :)
Back to the top
 
Posted
Rating:
#54627
Avatar

Community saint

Getting closer. I deleted this in global.css

Code

.global_zones ul {
margin-bottom: 0;
display: inline !important;
}
Now the menu loads and acts properly for the most part. The only thing wrong with it now is I made a link to my gallery with each album as a drop down link. When I am in the gallery the links to the other albums display but don't work, they are just text, not a link. Same thing with the link to my home page. Home link does not work from the gallery O_o
Back to the top
 
Posted
Rating:
#54628
Avatar

Community saint

A dumb question, but it's the menu is in the header.tpl, right?

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#54630
Avatar

Community saint

Not a dumb question. Yes it is, the zone menu. That is where it normally is anyways. My header is in the Global.tpl at the moment though…why I don't know lol I don't know if that is a bad thing or not. Maybe I should move my header into header.tpl?

I am guessing this bit of code tells it to use my header in the Global.tpl?

Code

{+START,IF_PASSED,EXTRA_HEAD}
{EXTRA_HEAD}
{+END}
Back to the top
 
Posted
Rating:
#54631
Avatar

Community saint

Yes. I think that might be one possible reason your links become inactive inside the gallery.

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#54632
Avatar

Community saint

It was worth a try for sure. I moved it and still no luck, links are inactive in the dropdown if I'm on the home page and if I'm in the gallery dropdown and home are inactive.
Back to the top
 
Posted
Rating:
#54641
Avatar

The dropdowns we have in 4.1 are pretty crappy frankly from a CSS/HTML perspective. I'd give you some advice but I've already flushed my mind of it.


Last edit: by Chris Graham


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#54642
Avatar

Community saint

:o Now that is blunt honesty, I like it :lol: You have been a lot of help already and I appreciate it.

OK I will stop beating my head against the wall and just go with a regular menu for now and add the dropdown later when I upgrade to 4.2….or try again later after I get the rest of the site built.
Back to the top
 
Posted
Rating:
#54646
Avatar

Yeah I'm ashamed of that particular code ;). It was the worst in ocPortal by far, so in 4.2 we rewrote it.

It does work, but I found I was getting confused with the HTML and CSS structure myself when customising for clients.
If you're nearly there don't let me put you off. It's just in my opinion it evolved into a mess.

When we don't do something right I'll be pretty reflective of it :).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#54652
Avatar

Community saint

Will give you a chance to play with 4.2 also... once again. lol

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#54670
Avatar

Community saint

I think I am happy with a regular menu for now. I want to focus on building my sites and making more themes.

I am tempted to upgrade right now Eric. But I got everything working and looking good, I am afraid to mess with it lol I will wait for the stable release….probably will install a test site to play with it on though, how can I not eh lol Gotta check it out.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Expand