1
india
block contents in top header bar????
  • 2004/4/25 16:53

  • india

  • Just popping in

  • Posts: 12

  • Since: 2004/2/21


How do I put the contents of any block into the top header bar. For exazmple, I used this news scroller block template code and inserted it in my theme.html in the header bar, but it doesnt work.

<table class="outer" cellspacing="1">
<tr>
<td><marquee behavior="scroll" direction="left" scrolldelay="90" scrollamount="9" onMouseOver="this.stop()" onMouseOut="this.start()">
<{foreach item=news from=$block.stories}>
<a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>" title="On (<{$news.date}>)"><{$news.title}></a> |
<{/foreach}>
</tr>
</marquee>
</td>
</tr>
</table>

Any advise on this please???

Thanks

2
CBlue
Re: block contents in top header bar????

<{foreach item=news from=$block.stories}>
<a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>" title="On (<{$news.date}>)"><{$news.title}></a> |
<{/foreach}>

All of the above is php code and you are putting it into an html file. You will need to use php includes to get this code to work.

Plus, I'd put your site's full url in the link instead of <($xoops_url)>

3
studioC
Re: block contents in top header bar????
  • 2004/4/25 17:27

  • studioC

  • Friend of XOOPS

  • Posts: 922

  • Since: 2003/12/7


aerm,... its not phpcode... its code out of a blocktemplate.. smarty and html...


@india
.Quote:
How do I put the contents of any block into the top header bar.


you can't load modultemplates within your theme this way. To let data out of modules be displayed in your blocks .. some script has to be load.

You may position a [free] themeblock at header within your theme and let your wanted block appear there...[using blockadmin]

Not all used smartys are available everywhere ..

greetings
michael


4
Mithrandir
Re: block contents in top header bar????

Erhm... CBlue... I hate to correct you like this, but it isn't php code. It's Smarty code. In a Smarty template (sowwy )

The problem is not the code, but the fact that the very first line takes an array ($block.stories) which is not filled with values.

The values are in the <{foreach item=block from=$xoopslblocks}> (or something like that) in your theme.html

The XOOPS theme system is not really geared for individual placement of individual blocks apart from the areas, which are pre-defined (left, right, center-center, center-left, center-right) so what you need is to define a new area (header, perhaps) and change the core files regarding block placement, adding the header area to the selectable options in system admin -> blocks

A little tough to do, though, so I wouldn't recommend that you do it unless you know PHP rather well.

5
CBlue
Re: block contents in top header bar????

Don't mind the corrections, thanks guys! Just trying to help india.

6
india
Re: block contents in top header bar????
  • 2004/4/25 17:29

  • india

  • Just popping in

  • Posts: 12

  • Since: 2004/2/21


thanks for your reply, but I dont understandQuote:
You will need to use php includes to get this code to work.
Theme.html has lots of smarty tags and php already, whats different here?

7
Mithrandir
Re: block contents in top header bar????

Oh yeah - as Michael suggests, you can change your theme to take an existing block area - e.g. center-center - and place it in the header area. Then position the block, you want in the header area, as the only center-right block on your site, and you should accomplish the same.

This means that in my little example, you should move the code-block
<!-- Start center-center blocks loop -->
            <{foreach 
item=block from=$xoops_ccblocks}>
              <{include 
file="default/theme_blockcenter_c.html"}>
            <{/foreach}>
            <!-- 
End center-center blocks loop -->
up to the header area in your theme.html

8
india
Re: block contents in top header bar????
  • 2004/4/25 17:32

  • india

  • Just popping in

  • Posts: 12

  • Since: 2004/2/21


Thanks Mithrandir, except bummer! it all looked easy for a moment.

9
CBlue
Re: block contents in top header bar????

I learn something new everyday! I didn't realize you could put a block in the theme.html file.

10
india
Re: block contents in top header bar????
  • 2004/4/25 17:36

  • india

  • Just popping in

  • Posts: 12

  • Since: 2004/2/21


Ok, Ive cought up now! Thanks cblue and guys for helping. I'll try this.

Login

Who's Online

184 user(s) are online (113 user(s) are browsing Support Forums)


Members: 1


Guests: 183


mailsdaddy,

more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits