Home Private Messages Search
CPG Dragonfly™ CMS stopsoftwarepatents.eu petition banner
Toggle Content
 
Forums ⇒ DragonflyCMS ⇒ Themes :: Archives ⇒ How to have 2 right block columns :: Archived


How to have 2 right block columns :: Archived
Announce themes that you have created, or ask questions about how to create/modify a theme in 9.x. Includes the Requests sub-forum.
Go to page 1, 2  Next
Post new topic    Revive this topic    Printer Friendly Page     Forum Index ⇒  Themes

Topic Archived View previous topic :: View next topic  
Author Message
ehoffman73
Platinum Supporter
Platinum Supporter

Offline Offline
Joined: Apr 22, 2004
Posts: 211
Location: Stillwater, MN
PostPosted: Sat Mar 26, 2005 4:43 pm
Post subject: How to have 2 right block columns

Trying to edit my template's footer.html file to allow two right blocks side by side...

am I close??

Code::
<!-- BEGIN bottomblock -->
<div class="table1">
  <div class="option" align="center"><strong>{bottomblock.S_TITLE}</strong></div>
  {bottomblock.S_CONTENT}
</div><br />
<!-- END bottomblock -->
{S_BANNER}
<!-- IF S_RIGHTBLOCKS -->
</td><td valign="top" class="mainside" id="pe601" {B_R_VISIBLE} align="right">
<!-- BEGIN rightblock -->
  <div class="blockheadr">{rightblock.S_TITLE} <img class="blockimg" alt="[x]" title="Show/hide content" id="pic{rightblock.S_BID}" src="{rightblock.S_IMAGE}" onclick="blockswitch('{rightblock.S_BID}');" /></div>
  <div class="blockcontent" id="pe{rightblock.S_BID}" {rightblock.S_VISIBLE}>{rightblock.S_CONTENT}</div><br />
<!-- END rightblock -->

<!-- IF S_RIGHTBLOCKS -->
</td><td valign="top" class="mainside" id="pe601" {B_R_VISIBLE} align="right">
<!-- BEGIN rightblock -->
  <div class="blockheadr">{rightblock.S_TITLE} <img class="blockimg" alt="[x]" title="Show/hide content" id="pic{rightblock.S_BID}" src="{rightblock.S_IMAGE}" onclick="blockswitch('{rightblock.S_BID}');" /></div>
  <div class="blockcontent" id="pe{rightblock.S_BID}" {rightblock.S_VISIBLE}>{rightblock.S_CONTENT}</div><br />
<!-- END rightblock -->
 <div class="mainside"></div>
<!-- ENDIF -->
</td></tr></table>
<br /><div align="center">{S_FOOTER}</div>
<!-- IF S_DEBUG_SQL --><div class="table1">{S_DEBUG_SQL}</div><!-- ENDIF -->
<!-- IF S_DEBUG_PHP --><div class="table1">{S_DEBUG_PHP}</div><!-- ENDIF -->
</div>
</body></html>


ehoffman73's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
W2003/IIS6/4.x/ /9.0.5
Back to top
View user's profile Visit poster's website Photo Gallery
DJ Maze
Developer
Developer

Offline Offline
Joined: Apr 19, 2004
Posts: 5683
Location: http://tinyurl.com/5z8dmv
PostPosted: Sat Mar 26, 2005 5:31 pm
Post subject: Re: 2 right blocks

No you are not.

Can you explain the full usage like:

- keep blocks on the right + add blocks in the footer
- no blocks on the right + add blocks in the footer

Because using <!-- BEGIN rightblock --> 2 times you just duplicate the whole list.

You could call
PHP:
themesidebox($title, $content, $custom_id);
within your theme.php

I will give a example
Code::
function themefooter() {
    global $banners, $cpgtpl;
    blocks('right');
    $cpgtpl->assign_vars(array(
        'B_R_VISIBLE'  => hideblock('601') ? 'style="display: none"' : '',
        'S_FOOTER'     => footmsg(),
        'S_BANNER'     => ($banners) ? viewbanner() : ''
    ));
// start custom part
    global $themeblockside;
    $themeblockside == 'customA';
    // a static block
    themesidebox('Block 1', 'My content', 5555);
    // a dynamic block
    $title = 'Block 2';
    include('blocks/block-CPG_Stats.php');
    themesidebox($title, $content, 5556);
// end custom part
    $cpgtpl->set_filenames(array('footer' => 'footer.html'));
    $cpgtpl->display('footer');
}

Then in your footer.html use this only once
Code::
<!-- BEGIN customAblock -->
  <div class="blockheadr">{customAblock.S_TITLE} <img class="blockimg" alt="[x]" title="Show/hide content" id="pic{customAblock.S_BID}" src="{customAblock.S_IMAGE}" onclick="blockswitch('{customAblock.S_BID}');" /></div>
  <div class="blockcontent" id="pe{customAblock.S_BID}" {customAblock.S_VISIBLE}>{customAblock.S_CONTENT}</div><br />
<!-- END customAblock -->

You can even do way more advanced things, but lets understand this first


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger Photo Gallery
ehoffman73
Platinum Supporter
Platinum Supporter

Offline Offline
Joined: Apr 22, 2004
Posts: 211
Location: Stillwater, MN
PostPosted: Sat Mar 26, 2005 7:15 pm
Post subject: Re: 2 right blocks

OKay, my page layout is thus: left blocks...center blocks...right blocks

sandwiched between header and footer code...

example now: www.purplepride.org/vikes

want to resemble columns on actual www.purplepride.org

so I want page layout to be:
header
left blocks...center blocks....right blocks....right blocks...
footer

Reading into what you are saying, is that somehow using the themesidebox may be my avenue?


ehoffman73's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
W2003/IIS6/4.x/ /9.0.5
Back to top
View user's profile Visit poster's website Photo Gallery
ehoffman73
Platinum Supporter
Platinum Supporter

Offline Offline
Joined: Apr 22, 2004
Posts: 211
Location: Stillwater, MN
PostPosted: Sat Apr 23, 2005 1:51 am
Post subject: Re: 2 right blocks

Thanks DJ, I am getting the hang of this. The right block is good, I just have home-page only blocks to add. So I can add CustomA block before the right block code to get that to fly, right?

So basically at the end of header.html, but then maybe also do the include once code around it like
<!-- IF PAGE_TITLE --><!-- ELSE --><!-- ENDIF --> so it only happens on the home page?

_________________
-----------------------

www.purplepride.org
Home of Vikings Fans Worldwide
www.wildfans.com
Home of Wild Fans Worldwide

ehoffman73's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
W2003/IIS6/4.x/ /9.0.5
Back to top
View user's profile Visit poster's website Photo Gallery
t31os
Supporter
Supporter

Offline Offline
Joined: Sep 22, 2004
Posts: 2025
Location: Somewhere in the intertubes... lolz
PostPosted: Sat Apr 23, 2005 2:03 am
Post subject: Re: 2 right blocks

Interesting, i like the suggestion DJ made, i can see how that works kinda, might have to play around with that myself, thats if i can do it without breaking my theme Confused


t31os's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
XP / 2.0 / 5.1 / 5.2 / none
Back to top
View user's profile Visit poster's website
DJ Maze
Developer
Developer

Offline Offline
Joined: Apr 19, 2004
Posts: 5683
Location: http://tinyurl.com/5z8dmv
PostPosted: Sat Apr 23, 2005 2:37 am
Post subject: Re: 2 right blocks

$home is a variable that tells you it's the home and not a module they see.
Code::
function themefooter() {
    global $banners, $cpgtpl, $home;
    blocks('right');
    $cpgtpl->assign_vars(array(
        'IS_HOME' => $home;
        'B_R_VISIBLE'  => hideblock('601') ? 'style="display: none"' : '',
        'S_FOOTER'     => footmsg(),
        'S_BANNER'     => ($banners) ? viewbanner() : ''
    ));
then in your footer.html
Code::
<!-- IF IS_HOME --><!-- ENDIF -->


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger Photo Gallery
t31os
Supporter
Supporter

Offline Offline
Joined: Sep 22, 2004
Posts: 2025
Location: Somewhere in the intertubes... lolz
PostPosted: Sat Apr 23, 2005 3:31 am
Post subject: Re: 2 right blocks

Cool, so if i did something like this in my footer....

Code::
<!-- IF IS_HOME -->
Hello my name is mud
<!-- ENDIF -->

Then that would only show up whenever the user is actually at index.php right? Very Happy

or

Code::
<!-- IF IS_HOME -->
Hello my name is mud
<!-- ELSE -->
Hello my name is rhubarb
<!-- ENDIF -->

Then if any page other then index.php i'm rhubarb right?

Or is it not that simple Confused


t31os's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
XP / 2.0 / 5.1 / 5.2 / none
Back to top
View user's profile Visit poster's website
DJ Maze
Developer
Developer

Offline Offline
Joined: Apr 19, 2004
Posts: 5683
Location: http://tinyurl.com/5z8dmv
PostPosted: Sat Apr 23, 2005 4:08 am
Post subject: Re: 2 right blocks

note that i used
Code::
'IS_HOME' => $home;


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger Photo Gallery
t31os
Supporter
Supporter

Offline Offline
Joined: Sep 22, 2004
Posts: 2025
Location: Somewhere in the intertubes... lolz
PostPosted: Sat Apr 23, 2005 3:53 pm
Post subject: Re: 2 right blocks

Yes i was aware thanx DJ dude Wink

This raises a question to, regarding the link of the Credits page etc, would you able to use something like above to only show it on the main page then hide it from the rest, would that be suitable to requirement?

I'm guessing someone will ask eventually so figured i might aswell tackle the question now.


t31os's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
XP / 2.0 / 5.1 / 5.2 / none
Back to top
View user's profile Visit poster's website
t31os
Supporter
Supporter

Offline Offline
Joined: Sep 22, 2004
Posts: 2025
Location: Somewhere in the intertubes... lolz
PostPosted: Wed Apr 27, 2005 6:23 pm
Post subject: Re: 2 right blocks

Also note that you need to add $home into the global area like in your example....

Thought i'd point that out since i've just used a modification of the above to only display banners on the main page of the site since i have them right at the top of the center column and don't want them sitting above every single module, its kinda like a nag screen for users to see it there on every page.

The above example provided me with enough info to work the idea into the theme.


t31os's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
XP / 2.0 / 5.1 / 5.2 / none
Back to top
View user's profile Visit poster's website
tyler_durden
Newbie
Newbie

Offline Offline
Joined: May 12, 2005
Posts: 33
Location: Mpls, MN
PostPosted: Fri Jun 03, 2005 10:51 pm
Post subject: Re: 2 right blocks

I have nothing important to add, other than I love the purplepride.org/vikes website ehoffman73 . I'm a diehard Vikes fan as well, living in Mpls, MN. Sorry if it's a little off subject!


tyler_durden's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Apache ?/MySQL 4.1.19-standard/PHP 4.4.2/9.0.6.1
Back to top
View user's profile Visit poster's website
ehoffman73
Platinum Supporter
Platinum Supporter

Offline Offline
Joined: Apr 22, 2004
Posts: 211
Location: Stillwater, MN
PostPosted: Sat Aug 06, 2005 3:28 pm
Post subject: Re: 2 right blocks

tyler_durden wrote:
I have nothing important to add, other than I love the purplepride.org/vikes website ehoffman73 . I'm a diehard Vikes fan as well, living in Mpls, MN. Sorry if it's a little off subject!


Thanks, hope to see you there. I will try this today and see how it all works!

_________________
-----------------------

www.purplepride.org
Home of Vikings Fans Worldwide
www.wildfans.com
Home of Wild Fans Worldwide

ehoffman73's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
W2003/IIS6/4.x/ /9.0.5
Back to top
View user's profile Visit poster's website Photo Gallery
ehoffman73
Platinum Supporter
Platinum Supporter

Offline Offline
Joined: Apr 22, 2004
Posts: 211
Location: Stillwater, MN
PostPosted: Sat Aug 06, 2005 5:45 pm
Post subject: Re: How to have 2 right block columns

quick check on what I'm doing wrong: on theme.php

Code::
function themefooter() {
    global $showblocks, $banners, $home, $cpgtpl, $foot1, $foot2, $foot3, $copyright, $start_time, $db;
    blocks('right');
    $cpgtpl->assign_vars(array(
		'IS_HOME' 		=> $home,
        'B_R_VISIBLE'   => hideblock('601') ? 'style="display: none"' : '',
        'B_R_HIDDEN'    => hideblock('601') ? '' : 'style="display: none"',
        'S_FOOTER'      => footmsg()
        )
    );
	// start custom part
    global $themeblockside;
    $themeblockside == 'customA';
    // a static block
    themesidebox('Gameday', 'My content', 5555);
    // a dynamic block
    //$title = 'Block 2';
    //include('blocks/block-CPG_Stats.php');
    //themesidebox($title, $content, 5556);
// end custom part
    $cpgtpl->set_filenames(array('footer' => 'footer.html'));
    $cpgtpl->display('footer');

and on the footer.html:

Code::
<!-- BEGIN bottomblock -->
	<div class="table1">
	<div class="option" align="center">{bottomblock.S_TITLE}</div>
	{bottomblock.S_CONTENT}
	</div><br />
	<!-- END bottomblock -->
	<!-- IF IS_HOME -->
	</td><td class="mainright" id="pe609" {B_R_VISIBLE}>
	<!-- BEGIN customAblock -->
  <div class="blockheadR">
  <img align="right" alt="Toggle Content" title="Toggle content" id="pic{customAblock.S_BID}" src="{customAblock.S_IMAGE}" onclick="blockswitch('{customAblock.S_BID}');"  style="cursor:pointer"/>&nbsp;&nbsp;{customAblock.S_TITLE}</div>
  <div class="blockcontent" id="pe{customAblock.S_BID}" {customAblock.S_VISIBLE}>{customAblock.S_CONTENT}</div>
	<!-- END customAblock -->

	<!-- ENDIF -->
	<!-- IF S_RIGHTBLOCKS -->
	</td><td class="mainright" id="pe601" {B_R_VISIBLE}>
	<!-- BEGIN rightblock -->

It shows the block under the main content but before the bottom blocks...and on every page. But only on the home page it does leave a whole column for custom blocks on the home page only!

Quick help?

_________________
-----------------------

www.purplepride.org
Home of Vikings Fans Worldwide
www.wildfans.com
Home of Wild Fans Worldwide

ehoffman73's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
W2003/IIS6/4.x/ /9.0.5
Back to top
View user's profile Visit poster's website Photo Gallery
t31os
Supporter
Supporter

Offline Offline
Joined: Sep 22, 2004
Posts: 2025
Location: Somewhere in the intertubes... lolz
PostPosted: Sat Aug 06, 2005 9:13 pm
Post subject: Re: How to have 2 right block columns

Thats because of <!-- IF IS_HOME --> which checks to make sure it is the home page the user is viewing, remove that and its ENDIF and it should work throughout the site...... Confused i think Confused

Wink


t31os's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
XP / 2.0 / 5.1 / 5.2 / none
Back to top
View user's profile Visit poster's website
ale1981
Nice poster
Nice poster

Offline Offline
Joined: Mar 15, 2005
Posts: 66
Location: Kent, UK
PostPosted: Wed Apr 05, 2006 9:23 am
Post subject: Re: How to have 2 right block columns

Thanks for the info Very Happy

I also used this to just display my phpAdsNew banners on the homepage.


ale1981's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux / 1.3.36 / 4.1.19 / 4.4.2 / CVS
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic    Revive this topic    Printer Friendly Page    Forum Index ⇒  Themes
Page 1 of 2
All times are GMT
Go to page 1, 2  Next

Archive Revive
Username:
This is an archived topic - your reply will not be appended here.
Instead, a new topic will be generated in the active forum.
The new topic will provide a reference link to this archived topic.
 
   Toggle Content User Info

Welcome Anonymous

Nickname
Password
(Register)

   Toggle Content Last CVS commits
· Fixed .ico Expires header.
· Removed domain name from cookies so subdomains wont access them anymore.
· CSS and JS, case insensitives.
· CSS and JS, send correct HTTP 1.1 headers and fixed issues where themes and...
· Further security class improvements.
· 301 redirects on LEO changes
· Option to force 3xx http status codes
· Validate googlebot.com and google.com crawlers.
· CCBot
· Rss with etag and atom.

read more...

   Toggle Content Community

Support for DragonflyCMS in a other languages:

Deutsch
Español

   Toggle Content X-links
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
Interactive software released under GNU GPL, Code Credits, Privacy Policy