What if you need 2 blocks with same title?
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexAdd-Ons & Blocks
Author Message
layingback
Forum Admin


Joined: Apr 19, 2004
Posts: 952

PostPost subject: What if you need 2 blocks with same title?
Posted: Wed Mar 17, 2010 4:16 pm
Reply with quote

If you have ever needed to have 2 blocks with the same title (or with no title) then you may have noticed that only the most recent of the 2 is listed for edit/delete in Admin > Blocks. [ You have to temporarily delete the latest one to be able to edit or delete the earlier one. ]

This is as a result of how the sort table is built to alphabetise the block list. The following will fix:

In admin/blocks.php around line 158 find:
Code:
//		$all[$row['title']] = $row;
and change to:
Code:
		$all[$row['title'].$row['bid']] = $row;

A by product of this change is that blocks with no title will now sort to the bottom of the list, rather than the top, built if there are 2 of them they will be listed separately.

_________________
Pro_News: The complete module for Dragonfly - now available as version 3.3

layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6 - 3.6 / 1.3.42 - 2.2.12 / 5.0.92 - 5.1.37 - 5.1.54 / 4.4.49 - 5.2.17 - 5.3 / 9.2.1
Back to top
View user's profile Visit poster's website
greenday2k
Forum Admin


Joined: Aug 11, 2005
Posts: 484
Location: CO

PostPost subject: Re: What if you need 2 blocks with same title?
Posted: Wed Mar 17, 2010 5:54 pm
Reply with quote

Awesome! This must be a bug fix. I'been working with center blocks without title and this is a ncie solution.

Now that you talk abour blocks without a title name here my theme code for those blocks (center top blocks):

for themes/ThemeName/header.html

Code:
<!-- BEGIN centerblock -->
<!-- IF centerblock.S_TITLE--><div class="pagetitle" align="center">{centerblock.S_TITLE}</div><!-- ENDIF -->
<div class="table1">{centerblock.S_CONTENT}</div> 
<!-- END centerblock -->

And for footer:

Code:
<!-- BEGIN bottomblock -->

  <!-- IF bottomblock.S_TITLE--><div class="pagetitle" align="center">{bottomblock.S_TITLE}</div><!-- ENDIF -->
 <div class="table1"> {bottomblock.S_CONTENT}
</div>
<!-- END bottomblock -->

_________________
www.greenday2k.net



greenday2k's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website MSN Messenger Yahoo Messenger
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3676
Location: Melbourne, AU

PostPost subject: Re: What if you need 2 blocks with same title?
Posted: Thu Mar 18, 2010 10:25 am
Reply with quote

Fixed in 10 and 9 branches thanks Smile
_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
MySQL 5.1 / PHP 5.3 / NextGen()
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexAdd-Ons & Blocks All times are GMT
Page 1 of 1


Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Dedicated Server & Bandwidth Sponsored by DedicatedNOW
User Info [x]

Welcome Anonymous

Nickname
Password
(Register)

Last CVS commits [x]

Languages [x]

Community [x]

Support for DragonflyCMS in a other languages:

Deutsch
Español

X-links [x]
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

Preview theme [x]
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.


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
This page generated in 0.7178 seconds with 16 DB Queries in 0.32 seconds
Memory Usage: 2.87 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy