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 

nukeSEO(dh) improvements
 
 
Post new topic   Reply to topic    nukeSEO.com Forum Index -> nukeSEO (tm)
View previous topic :: View next topic  
Author Message
Guardian
webmaster


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

PostPosted: Sat Nov 12, 2011 4:56 am    Post subject: nukeSEO(dh) improvements Reply with quote

I'm curious if there will be any enhancements in nukeSEO(dh) for RavenNuke 2.5 ?
Specifically, I'm really looking to be able to dynamically over ride ALL header code and even insert some extra ones (like google site verification meta tags) but most importantly, the ability to reference a CDN.

At the moment (without extensive code modifications) I cannot reference a jQuery file on a CDN without nukeSEO(dh) also utilising RavenNukes jQuery file.

As above but substitute CSS file.
  
Back to top
View user's profile Send private message
kguske
Site Admin
Site Admin


Joined: May 12, 2005
Posts: 876

PostPosted: Mon Nov 14, 2011 9:18 am    Post subject: Reply with quote

Nothing planned for 2.5. I'm hoping to add the ability to create / override other HEAD tags, but not specifically JS or CSS loads.

I haven't reviewed, but would think the CDN could be added outside DH (e.g. in the addJSToHead function in mainfile.php). If something wants to add local jQuery, intercept that in addJSToHead and replace with CDN.
_________________
  
Back to top
View user's profile Send private message Visit poster's website
kguske






PostPosted: Mon Nov 14, 2011 9:21 am    Post subject: Reply with quote

You could have an array of alternates, and configure that to be switchable (i.e. use the CDN on / off) vs. the local copy.
  
Back to top
Guardian






PostPosted: Mon Nov 14, 2011 11:08 am    Post subject: Reply with quote

Yes that is what I'm doing at the moment. I declare a Constant in my module index file and that acts as a switch to determine whether I use the local jQuery files or a remote ones.
It works ok but is a little messy in terms of having to hack the core code about. I'm eager, for example, to create modules using some HTML5 features and utilise the CDN I have set up for core JS/CSS files as well as themes CSS files.
Whilst it is possible to do it right now in the manner you have described, I couldn't contemplate allowing third parties to use these types of modules because they would need to hack about the core code and 'simplicity' for third parties to install modules is paramount to me, not to mention it could get messy at upgrade time when core files would be over written.

I started this thread on the spur of the moment and heven't looked at the nukeSEO(dh) associated code in quite a while but I just had the thought that we already have a custom_header.php file which if memory serves is execute after the main header (though still before the closing HEAD tag) so maybe it might be easier for me to create a new main header.php file and add a line in mainfile to execute that one instead of the core header.php file - this might keep maintenance down a little.
  
Back to top
spasticdonkey
webmaster


Joined: Oct 26, 2007
Posts: 69

PostPosted: Fri Nov 25, 2011 6:48 pm    Post subject: Reply with quote

Seems like it might be a good idea to wrap the writeHEAD function in a
Code:
if ( !function_exists('writeHEAD') ){};


Then writeHEAD could be overridden in custom_mainfile, and you could do as kquske suggested above... Could also have implementations such as dynamic minification of CSS and JS files, which would of course have to play nicely with any CDN files.

There may be other alternatives, but I toyed with this some time ago.
http://code.google.com/p/minify/

only way I can think of at current to do this without core edits, would be to upload a blank version of jquery.js and use custom_mainfile to include your CDN scripts... but less than ideal, unless we had dynamic minification which is kinda a catch22 Smile
  
Back to top
View user's profile Send private message Visit poster's website
Palbin
webmaster


Joined: Nov 28, 2007
Posts: 38

PostPosted: Fri Nov 25, 2011 8:23 pm    Post subject: Reply with quote

spasticdonkey wrote:
Seems like it might be a good idea to wrap the writeHEAD function in a
Code:
if ( !function_exists('writeHEAD') ){};


Then writeHEAD could be overridden in custom_mainfile, and you could do as kquske suggested above... Could also have implementations such as dynamic minification of CSS and JS files, which would of course have to play nicely with any CDN files.


I am not sure what you know about classes, but this would be a great use so you do not have to redefine writeHEAD. If the default function where in a class you could just extend them. I have not really thought about what you are doing, but just wanted through in my two cents about classes.
  
Back to top
View user's profile Send private message
Guardian






PostPosted: Sat Nov 26, 2011 10:10 am    Post subject: Reply with quote

Yeah, I have actually just started to create my own module-header.php within the module instead of including the core header.php file but over-ridding the writeHEAD function is definitely interesting and something I'll look at.
As for the CND, my GitHub CDN files are minified and they are served from the CDN in a compressed form automatically to reduce the file size.
  
Back to top
spasticdonkey






PostPosted: Mon Nov 28, 2011 1:12 pm    Post subject: Reply with quote

I have to admit my knowledge of the inner workings of classes is somewhat limited. I'm open to any method that adds some versatility to the system...

After thinking about this and doing a little testing, here's another approach (that would require no core edits). While their may be a more efficient method to replace a value in a multidimensional array; I'll leave that to you Wink

For a global replacement of jquery to use a cdn, create includes/addons/body-cdn.php
(using body addon because jquery.js may be included by some head.xxx files)

Code:
if (!defined('NUKE_FILE')) die ('You can\'t access this file directly...');

global $headJS;
$needle = array('file','includes/jquery/jquery.js');
$replacement = array('file','http://code.jquery.com/jquery-1.6.2.min.js');
for($i=0;$i<count($headJS);$i++) {
   if($headJS[$i] == $needle) {
   $headJS[$i] = $replacement;
   }
}


Only possibility that the core jquery.js could be included after that, is with the use of RN_MODULE_HEAD, which is unused within the distro at this point.... But could possibly be used by some 3rd party addons.

By the way, RN_MODULE_HEAD would be perfect for any module level overrides of CSS/JS using the same method.... as it is included just prior to writeHEAD()

Just another take on an approach that doesn't have to wait for improvements/enhancements to the dh system.
  
Back to top
Guardian






PostPosted: Mon Nov 28, 2011 3:20 pm    Post subject: Reply with quote

I was just looking at includes/nukeSEO/nukeSEOfunctions.php
There is some commented out code there that could be used to 'extend' the nukeSEOdh class.
Although the above is only meant for meta data, it takes care of some things I need to do.
I really need to spend a day or two getting to grips with it but I'm snowed under with a couple of modules that are on the go and trying to create a nice black theme.
  
Back to top
Guardian






PostPosted: Sun Apr 15, 2012 4:05 pm    Post subject: Reply with quote

Didn't want to start a new topic as the subject line is relevant but just wanted to ask (kguske), if there are is anything within the nukeSEOdh roadmap to add multi-lingual capabilities?
Specifically, I'm thinking about $slogan, which would really need to be language aware and of course some of the meta data like keywords.
  
Back to top
Display posts from previous:       
Post new topic   Reply to topic    nukeSEO.com Forum Index -> nukeSEO (tm) 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.09 Seconds