Check alle échte Black Friday-deals Ook zo moe van nepaanbiedingen? Wij laten alleen échte deals zien

[PHP CSS]Probleem met expanding menu..

Pagina: 1
Acties:
  • 27 views sinds 30-01-2008

  • Dannydekr
  • Registratie: Januari 2005
  • Laatst online: 24-11 21:27
Ik ben bezig met een website die ExponentCMS gebruikt. Alles leuk en wel, maar het menu dat gewenst is is redelijk lastig.

Dit is zoals het eruit moet zien wanneer je op een subitem drukt (dit plaatje is als je op de mainlink drukt)

Afbeeldingslocatie: http://members.chello.nl/akruik/good.png

En dit is wanneer je dus momenteel op een subitem drukt :( ...

Afbeeldingslocatie: http://members.chello.nl/akruik/bad.png

Exponent gebruikt voor zaken als deze een TPL file, die ik al ver aangepast heb. Ik zelf zat te denken aan een PHP code die alles menuitems die ubitems onderzich hebben een aparte style geeft. Ik heb dit echter nog niet voor elkaar gekregen....

Dit is de inhoud van de TPL file zoals die nu op dit moment is:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<table cellpadding="0" cellspacing="0" border="0" width="200" style="margin-left:0px;margin-top:0px;">
{foreach from=$sections item=section}
{assign var=commonParent value=0}

{foreach from=$current->parents item=parentId}
    {if $parentId == $section->id || $parentId == $section->parent}
        {assign var=commonParent value=1}
    {/if}

    

{/foreach}
{if $section->numParents == 0 || $commonParent || $section->id == $current->id ||  $section->parent == $current->id}
<tr>
    {if $section->numParents == 0}
    <td style="border-top: 3px #733907 solid; padding-top:0px; padding-bottom:0px;">
    {/if}
    {if $section->numParents <> 0}
    <td style="padding-bottom: {math equation="x*0" x=$section->depth}px">
    {/if}
    
    {if $section->active == 0  && $section->numParents == 1  }
    {if $section->id == $current->id} 
    <div style="background-color: #FFFFFF; margin: 0px; padding: 0px; width: 162px; overflow:visible; position: relative;"> 
    {/if}
{/if}
    
{if $section->active == 1  && $section->numParents == 0 }
    {if $section->id == $current->id} 
      
      <div style="background-color: #FFFFFF; width: 162px; overflow:visible; position: relative;">  
        
        <a href="{$section->link}" class="navlink_current"{if $section->new_window} target="_blank"{/if}> &nbsp;&nbsp;&nbsp; {$section->name} </a> &nbsp;
        
        </div>
        
{/if}
    
    {if $section->id != $current->id}
        
        <a href="{$section->link}" class="navlink"{if $section->new_window} target="_blank"{/if}>&nbsp;&nbsp;&nbsp; {$section->name} </a>&nbsp;
    
    {/if}
{/if}


{if $section->numParents <> 0 }

<div style="padding-bottom: 0px; background-color:#FFFFFF; width: 162px; overflow:visible; position: relative;">
    
    {if $section->id == $current->id}
<div style="background-color: #FFFFFF; margin: 0px; padding: 0px; width: 162px; overflow:visible; position: relative;"> 
        <a href="{$section->link}" class="navlinksmallcurrent"{if $section->new_window} target="_blank"{/if}>&nbsp;&nbsp;&nbsp; {$section->name} </a>
        </div>
    {/if}
    
    <div style="background-color: #FFFFFF; margin: 0px; padding: 0px; width: 162px; overflow:visible; position: relative;"> 
    {if $section->id != $current->id}
        <a href="{$section->link}" class="navlinksmallcurrent"{if $section->new_window} target="_blank"{/if}>&nbsp;&nbsp;&nbsp; {$section->name} </a>
    {/if}
    </div>
    </div>
</div>


{/if}
</td></tr>
{/if}
{/foreach}
</table>
{permissions level=$smarty.const.UILEVEL_NORMAL}
{if $canManage == 1}<br/>
[<a class="navlink" href="{link action=manage}">BEHEER PAGES</a>]
{/if}
{/permissions}

Those who surrender freedom for security will not have, nor do they deserve, either one.


Verwijderd

Om deze vraag te beantwoorden moet je de stylesheet bijvoegen, niet de CMS template. Los daarvan zou het helpen als je alleen relevante tpl code zou bijvoegen, en niet het hele bestand...

[ Voor 36% gewijzigd door Verwijderd op 23-07-2007 18:03 ]


  • Dannydekr
  • Registratie: Januari 2005
  • Laatst online: 24-11 21:27
Er zit niets in de stylesheet m.b.t het probleem...

Those who surrender freedom for security will not have, nor do they deserve, either one.


  • Cavorka
  • Registratie: April 2003
  • Laatst online: 27-03-2018

Cavorka

Internet Entrepreneur

Tsja.

Geef anders een stuk geparste html in plaats van deze template en dan de bijbehorende CSS file, want een niet geparste template en dan ook nog in deze vorm (onduidelijk anyone?) zegt niet zo veel.

Maar van wat ik zover kan zien: div's in tables. Ouch. En dynamische bottom paddings?

the-blueprints.com - The largest free blueprint collection on the internet: 50000+ drawings.


  • Dannydekr
  • Registratie: Januari 2005
  • Laatst online: 24-11 21:27
Dat is de standaard opmaak voor het menu in Exponent... ik heb alleen wat style="" dingen toegevoegd, en voor de tekst classes mee gegeven.

Those who surrender freedom for security will not have, nor do they deserve, either one.


  • coubertin119
  • Registratie: Augustus 2002
  • Laatst online: 10:34
Het ding werkt toch al met Javascript (neem ik toch aan, ik zie geen geparste HTML, dus ik heb er het raden naar, maar ik hoop dat je voor je menu niet elke keer een refresh doet), dus moet je ervoor zorgen dat bij de functieaanroep om het menu uit te vouwen ook een toggle wordt gedaan naar 'active', voor het item op het 1e niveau. De stijldeclaratie voor active elementen geef je dan gewoon een witte achtergrond en klaar is kees.

Skat! Skat! Skat!


  • XangadiX
  • Registratie: Oktober 2000
  • Laatst online: 26-05 15:01

XangadiX

trepanatie is zóó kinderachtig

Ik zou de topicstart even herzien, een demobestand maken en de relevante code posten.

Stoer; Marduq


  • BtM909
  • Registratie: Juni 2000
  • Niet online

BtM909

Watch out Guys...

En heb je een clientside probleem, lever dan ook client side code op :)

Ace of Base vs Charli XCX - All That She Boom Claps (RMT) | Clean Bandit vs Galantis - I'd Rather Be You (RMT)
You've moved up on my notch-list. You have 1 notch
I have a black belt in Kung Flu.

Pagina: 1

Dit topic is gesloten.