How to push script to G3 <head>??
|
hebhansen
![]()
Joined: 2009-02-10
Posts: 572 |
Posted: Fri, 2010-03-12 20:16
|
|
I need to include a script to html <head>. I tried this: created file in views folder of the module: added: Quote:
<?php defined("SYSPATH") or die("No direct script access.") ?> will this include the script correctly? all the best |
|


Posts: 2138
From module?
under modules/<mymodule>/helpers/mymodule_theme.php
static function head($theme) {
/* for css */
$theme->css("mymodule.css");
/* for JS */
$theme->script("mymodule.js");
return "";
}
Posts: 572
Yes from module called "front"
are you serious about theme? it's a module??
front/helpers/mymodule_theme.php
Inside this file:
So the script is placed in front.js. I need this cut outfor sissies, otherwise I am lost in php or what ever this code is
What happened to:
and
all the best
HB - http://www.image.agentura.dk
Posts: 2138
It is visual stuff, right? so yes, it is event in the module related to theme rendering
You can call it as you want, but for simplicity, yes. Easier to track later.
give it a try, you will see
No such thing...
Posts: 572
I will try..
Is there a simple way to call fx a block as is - fx image block or language block into my front/views/front.php?
I am writing html and I want to add components from aroung G3. However, this php syuff is killing me.
all the best
HB - http://www.image.agentura.dk
Posts: 572
front.js goes in js folder?
and whats around the:
start script
end script
will I need this?
all the best
HB - http://www.image.agentura.dk
Posts: 572
Source code after making the changes.... and it doesn't display nice
all the best
HB - http://www.image.agentura.dk
Posts: 2138
Cannot comment much. Willing to share current modele's code?
Posts: 572
I need this to work in a clean page that I can html edit around it. Displays a swf basically. I want it to be named front:
all the best
HB - http://www.image.agentura.dk
Posts: 572
after that I need to solve the block issue above. Code attached is where I am at. front.css is there front_html.php, front.js and front_theme.php
Files called from code, I have intact. they must be at same level as what would be an index.html, wherever that is in a G3 module.
all the best
HB - http://www.image.agentura.dk
Posts: 2138
Ok, try replacing with this in the file front_theme.php
Note. Your JS breakes stuff. See included file. No php should be present in JS
Posts: 2138
Another question... if the only thing you are trying to do is to put a flash as a front page on start up, why not just put index.html in the root and be done?
Posts: 572
I am trying to create a front for G3 as I want it, out of the G3 engine so to say I will make it in panels with individual subjects. The objective is to bring spacerequiring blocks to front. img Block, Tag cloud, gtags, Language Flags. They can be removed from sidebar and only displayed on front/ home of G3. This will save space in sidebar and G3 will never scroll. Other links from sidebar can then move to Fisheye Menu module.
http://codex.gallery2.org/Gallery3:Modules:fisheye_menu
For now, sidebar is handling only dynamic links and stuff not in front and not a Primary/Secondary link in Fisheye
This module should be a rip off of Floridaves about module. Only issue is that G3 has a bug, so that when admin fields including " are saved, it adds '\' x 2 + 1!!! So coding in forms get screwed over.
That leaves me at the about module, hacked and hardcoded. So why the module. This for others to do what I do and not have the hazzle that I do for this very basic request. No I am not at all on top of the G3 module structure and certainly not php. So expect tons of questions for now.
Also, this gives me the opportunity to display stuff on fron only. fx. Language flag is only required there.
However, your help is most appreciated
- I noticed your theme, looks cool and great work IMO. One thing I don't get is that G3 sells this product under Wind. Visual is everything for everyday users. Wind looked like that since G1 saw dawn and the 80 design will keep most people away. Ship G3 in a nice package and see what happens. This is meant in a constructive way and to the best of interest in Gallery. Developers behind it deserve that.
This is the face of my site. The above is a flash
all the best
HB - http://www.image.agentura.dk
Posts: 572
Added your code and it seems that head is not read propperly. Superfish menu is missing, Fisheye menu is missing or at least the script. Can the code be placed in bottom of <head somehow>?? if that change things?
Sourcecode:
The above <head> and <body> was placed in flow.html before. At the same level all scripts and floders are placed. If I need same folder then what
index.html
folder 1
folder 2
file 1
file 2
G3 module
front
- helpers
- <head>
- views
- <body>
what is my index.html ???
all the best
HB - http://www.image.agentura.dk
Posts: 572
I think this is going to be quite proprietary so I will move this inside my theme. Is that possible? And will G3 allow a view from there to be front?
all the best
HB - http://www.image.agentura.dk