nukeSEO.com - PHPNuke SEO Search engine optimization, professional tools including nukeSEO, nukeSPAM, nukeFEED, nukePIE, nukeWYSIWYG and more

 

. Welcome to nukeSEO.com  ! 
.
.
.


.
nukeSEO.com: Forums


 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

block control
 
 
Post new topic   Reply to topic    nukeSEO.com Forum Index -> PHP-Nuke enhancement ideas
View previous topic :: View next topic  
Author Message
nextgen
webmaster


Joined: Nov 17, 2008
Posts: 29
Location: Maryland

PostPosted: Fri Aug 03, 2012 7:25 pm    Post subject: block control Reply with quote

I have always wanted block control per module in ravennuke.
_________________
Image
  
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
spasticdonkey
webmaster


Joined: Oct 26, 2007
Posts: 69

PostPosted: Sat Aug 04, 2012 9:25 am    Post subject: Reply with quote

I know what you mean, I would like that too.. but I understand why it hasn't happened. With so many conditions that effect the display of blocks already (user,anonymous,groups,language,etc) it would add yet another layer of complexity. Not to say it can't or won't be done someday, but I'm having trouble visualizing how it would be administered as well... the blocks acp really needs some UI improvements prior to attempting something like this, imo.

In the meantime you can create custom blocks that can change content in a variety of ways. This is just an example of some things that could be done.

Special content for block when using Your_Theme
Code:
$ThemeSel = get_theme();

if($ThemeSel=='Your_Theme'){
   // Special content for block when using Your_Theme
   $content = 'Here is special content only when viewing with ' . $ThemeSel;
} else {
   // Not Your_Theme
   $content = 'All other themes get this :)';
}


Different block if both columns of blocks are visible
Code:
if (defined('INDEX_FILE') AND INDEX_FILE===true) {

   // Different block if both columns of blocks are visible
   $content = 'Looks like both columns of blocks are visible!';
} else {
   // Only a single column of blocks
   $content = 'Only a single column of blocks can be seen!';
}


Special block when on the home page
Code:
if (defined('HOME_FILE')) {

   // Special block when on the home page
   $content = 'Home Sweet Home';
} else {
   // Not the homepage
   $content = 'Nobody is home :(';
}


Module specific block
Code:
$module_name = basename(dirname(__FILE__));

if ($module_name == 'Some_Module') {
   $content = 'Hey this is Some_Module!';
} else if($module_name == 'Content') {
   $content = 'Feeling Content';
} else if($module_name == 'Forums') {
   $content = 'Hey it is the forums';
} else {
   $content = 'Content for everywhere else';
}


This last one is more for sharing a block with others, as there is no way to dynamically switch columns. Useful when you need to do special stuff depending on the column location of the block.
Code:
if (!isset($side)) $side = '';

if ($side == 'c' || $side == 'd' || $side == 't') {
   $content = 'center block';
} else if($side == 'l') {
   $content = 'left side';
} else if($side == 'r') {
   $content = 'right side';
} else {
   $content = 'unknown error';
}


These are basic examples, but you could certainly nest whatever code inside that you need, or modify/combine/addto the logic..
  
Back to top
View user's profile Send private message Visit poster's website
nextgen






PostPosted: Wed Aug 22, 2012 11:39 am    Post subject: Reply with quote

What made me want it more was the fact that nuke evo has a great block control system but is a bit bloated for my needs. I know it is a very in depth change that would be required to achieve this but we can all dream right. Thanks yet again friend.

Your examples will help so much.
  
Back to top
Guardian
webmaster


Joined: Dec 25, 2005
Posts: 364
Location: Vsetin, Czech Republic

PostPosted: Thu Feb 07, 2013 11:27 am    Post subject: Reply with quote

I know this is an old thread but if something like was ever under taken by the RN Team, I would probably prefer block files themselves to be moved into the modules directory.
Most blocks are only meant to display data that belong to a specifc module so it would make sense to put them there for "modularity". Unfortunatley that would mean a ton more coding Sad
  
Back to top
View user's profile Send private message
Palbin
webmaster


Joined: Nov 28, 2007
Posts: 38

PostPosted: Tue Feb 12, 2013 6:45 pm    Post subject: Reply with quote

Would you store the module name in the DB with the block then? Would you suggest having to "install" the block?
  
Back to top
View user's profile Send private message
Guardian






PostPosted: Mon Feb 18, 2013 6:55 am    Post subject: Reply with quote

I must check my account settings here as I missed the reply notification email - sorry for the delayed response!

It's a tricky one. I haven't really put much thought into the actual process but it just seems more logical to put block files that use module data to be located within the module directory i.e.
/modules/My_Module/blocks/block-myblockfile.php
I think that makes modules more 'modular' in the sense that all the files are contained within that one directory.

For stand alone block files e.g. a menu, I would envisage those staying in the current block file location.

Spasticdonkey is working on something right now as part of our GUI stuff to give enhanced block output handling i.e. render different blocks in different locations depending on the theme and/or possibly module that is loaded.
Although that work is primarily to enhance the mobile device responsiveness of Bootstrap derived themes, it could probably be further enhanced at some point once the dust settles a bit because we are using a theme_config table to hold the key/value pairs, so it shouldn't be too difficult to add one more field for the module name.
  
Back to top
montego
webmaster


Joined: Dec 26, 2005
Posts: 254

PostPosted: Thu Feb 21, 2013 7:57 am    Post subject: Reply with quote

Something Raven and I have talked about for years is even a more flexible layout / content engine where any content is plug-able into any "container". Its kind of funny because we developed the same thoughts independently and I had even create something called NukeForge which does this already. I never released it because I wasn't experienced enough at the time to write the administration component.

You can actually see it in action on my site Only registered users can see links on this board! Get registered or login!. What you are actually seeing there is a layout that I have simply create content "adapters" to assign to each content tag within the layout. Then, in the DB, I capture the parameters to be passed in to the adapters so they generate the right content.

As you can see from my posted example, different forums threads are present (multiple instances of the same adapter just passed with different forum ID's) and then the HTML Newsletter News topic ID passed in to that adapter.

Anyways... way far out there, but the above sounds like it is still on a similar path and what we learn from doing the flexible blocks might help down the road. Wink
_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login!
  
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    nukeSEO.com Forum Index -> PHP-Nuke enhancement ideas All times are GMT - 5 Hours
 
 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

Powered by phpBB © 2001-2008 phpBB Group


Page Generation: 0.04 Seconds