Re: help with smarty template

i decided to change it using range

<{php}> $number= range(1, 10000); shuffle($number); echo "<ul id='treemenu".$number[0]."' class='treeview'>"; <{/php}>



Report
Topic


Re: help with smarty template

Great. It deserves a blog post...

Report
Topic


Re: help with smarty template

i think i solved this..i did it like this

<{php}> $number= array( 0 => "1", "2", "3", "4", "5", "6", "7" , "8" , "9" , "10" ); shuffle($number); echo "<ul id='treemenu".$number[0]."' class='treeview'>"; <{/php}> <{foreach item=menu from = $block}> <{if $menu.oul}> <{if $menu.level == 0}> <{elseif $menu.level == 1}> <{else}> <ul> <{/if}> <{/if}> <{if $menu.oli}> <{if $menu.level == 0}> <li> <{else}> <{/if}> <{/if}> <{if $menu.level == 0}> <{if $menu.hassub}> <{else}> <a href="<{$menu.link}>" target="<{$menu.target}>" alt="<{$menu.alt_title}>" title="<{$menu.alt_title}>"><{$menu.title}></a></li><{/if}> <{if $menu.hassub}><li> <{$menu.title}> <ul><{/if}> <{else}> <li><a href="<{$menu.link}>" target="<{$menu.target}>" alt="<{$menu.alt_title}>" title="<{$menu.alt_title}>"><{$menu.title}></a> <{/if}> <{if $menu.close != ''}><{$menu.close}><{/if}> <{/foreach}> </ul> <script type="text/javascript"> //ddtreemenu.createTree(treeid, enablepersist, opt_persist_in_days (default is 1)) ddtreemenu.createTree("treemenu<{php}>echo "$number[0]";<{/php}>", true) ddtreemenu.flatten('treemenu<{php}>echo "$number[0]";<{/php}>', 'contact') </script>

Report
Topic


Re: help with smarty template

  • 2012/3/17 13:38:49
  • Will

you can also use cycle. http://www.smarty.net/docsv2/en/language.function.cycle

Report
Topic


Re: help with smarty template

the code is working fine

its just i can't have two same block in one page

so i must have diff id

Report
Topic


Re: help with smarty template

<ul id="treemenu<{$block.id}>" class="treeview"> <{foreach item=menu from = $block}> <{if $menu.oul}> <{if $menu.level == 0}> <{elseif $menu.level == 1}> <{else}> <ul> <{/if}> <{/if}> <{if $menu.oli}> <{if $menu.level == 0}> <li> <{else}> <{/if}> <{/if}> <{if $menu.level == 0}> <{if $menu.hassub}> <{else}> <a href="<{$menu.link}>" target="<{$menu.target}>" alt="<{$menu.alt_title}>" title="<{$menu.alt_title}>"><{$menu.title}></a></li><{/if}> <{if $menu.hassub}><li> <{$menu.title}> <ul><{/if}> <{else}> <li><a href="<{$menu.link}>" target="<{$menu.target}>" alt="<{$menu.alt_title}>" title="<{$menu.alt_title}>"><{$menu.title}></a> <{/if}> <{if $menu.close != ''}><{$menu.close}><{/if}> <{/foreach}> </ul> <script type="text/javascript"> //ddtreemenu.createTree(treeid, enablepersist, opt_persist_in_days (default is 1)) ddtreemenu.createTree("treemenu<{$block.id}>", true) ddtreemenu.flatten('treemenu<{$block.id}>', 'contact') </script>

Report
Topic


Re: help with smarty template

How are you done foreach in blocks?. Copy the full code please

Report
Topic


Re: help with smarty template

when i use <{$block.id}> its not working..i can see just the word number without the block id

<ul id="number<{$block.id}>" class="example"> <li><{$hello.title}></li> </ul> <script type="text/javascript"> hello.create("number<{$block.id}>", true) </script>



for the second solution it will not work because each block will have the same array

Report
Topic


Re: help with smarty template

For get the block.id for each block add in your template as this example
<div class="blockTitle block<{$block.id}>"
You will get class="blockTitle block23"

Example changing values in foreach for id

<ul><{assign var=solapa value=0}> <{foreach item=block from=$xoBlocks.tabs}> <{assign var=solapa value=$solapa+1}> <li><a href="#contenido<{$solapa}>"><span><{$block.title}></span></a></li> <{/foreach}> </ul> <{assign var=solapa2 value=0}> <{foreach item=block from=$xoBlocks.tabs}> <{assign var=solapa2 value=$solapa2+1}> <div id="contenido<{$solapa2}>" class="solapa"> <div class="left-block-content solapa2"><{$block.content}></div> </div> <{/foreach}>


If this not help, Could you explain the question more detailed?

Report
Topic


help with smarty template

example i have this code in a block template

<ul id="number1" class="example"> <li><{$hello.title}></li> </ul> <script type="text/javascript"> hello.create("number1", true) </script>


how do i have different value of id for each block

so first block will be number1
second block (cloned block) will be number2 and so on
and the value inside the script also change

.noob here..is this possible ?

Report
Topic


Re: My first attempt at using Bootstrap 2.0 on ImpressCMS

Well done! . It is a very good approach and it opens new themeing possibilities

Report
Topic


Re: My first attempt at using Bootstrap 2.0 on ImpressCMS

Thanks for the response! This is a work in progress of course. I just wanted to see if my solution worked on sites other than the ones I currently test with

The boiler framework has a very strong point in that it is compatible with the current templates, which my solution isn't. (It might be possible, but I don't know how personally).

On the other hand, bootstrap is not specific to ImpressCMS, so it could be easier to sell it as a solution to theme developers.

Next steps on this : get the system module templates converted to be compatible with bootstrap (and possibly try to make them HTML5 compliant). After that, try to port some existing themes.

Me on OpenHub

Report
Topic


Re: My first attempt at using Bootstrap 2.0 on ImpressCMS

Another nice new theme framework - awesome!

A quick look around and there are 3 scripts that are loading - transition, collapse and script. Plus, they are being called 2x each.

Same comment as I made on Will's boiler framework - anything that is going to be site-specific is fantastic stuff for custom tags.

Looking forward to a great set of new themes built on this and boiler for the upcoming releases and for CMS Expo!

Christian Web Resources
Facebook
Report
Topic


Re: My first attempt at using Bootstrap 2.0 on ImpressCMS

  • 2012/3/13 15:56:31
  • QM-B

I just could do a few quick tests around. You're right, the templates need to be more adjusted.. I was running in a lot of conflicts yet. But a nice work. Would be nice to see it fully compatible.

Report
Topic


Re: My first attempt at using Bootstrap 2.0 on ImpressCMS

  • 2012/3/13 13:23:26
  • Will

Cool, you got it going.

Question: what is this for?

<{assign var=theme_name value=$xoTheme->folderName|cat:'/templates'}>


were you doing this to try and move all your html files into a templates folder?

Report
Topic


Re: My first attempt at using Bootstrap 2.0 on ImpressCMS

  • 2012/3/13 13:13:21
  • david

Very neat work indeed!

Report
Topic


My first attempt at using Bootstrap 2.0 on ImpressCMS

Since I looked at Twitter Bootstrap a few weeks ago, I was amazed by the solid foundation it gives you to build a site layout on. On and off (we're also working on CMSExpo 2012, remember to let me know if you care to help organising) I've been tinkering with a theme built from a package from Initializr.

I've got the very first work-in-progress version ready for you to play with.

You will need to change the templates for your site. The current templates aren't totally compatible.

I'll get around to those shortly, but if you want to help me rewrite the templates in HTML5 and Bootstrap, let me know.

Array

Me on OpenHub

Report
Topic


Re: Anybody got the Belius theme...

  • 2012/3/6 16:26:10
  • david

I've voted for it as well... the more votes the merrier!

Report
Topic


Re: Anybody got the Belius theme...

I checked again, and Assembla support responded to my question a month ago. That's a functionality that isn't there yet.

If you have an assembla account, please vote for SVN Download Folder. Thanks!

Me on OpenHub

Report
Topic


Re: Anybody got the Belius theme...

Yes, i haven't figured out yet if the possibility exists like trac offers to download a part of a SVN repository. I've looked around, but found nothing.

Me on OpenHub

Report
Topic



 Top