I want to create some very basic landing pages, but do not want them to have any of the regular site styles. I have built some standard html/css/js templates, but am stumped. I know that this would be a perfect panels situation, but I appear to be panels deficient...and really don't want to load up ctools/panels/jquery_ui to do this simple task.
I 'think' that I can simply build a landing-page.tpl.php, and strip out all of the regular drupal stuff, but how can I load only the assets from a landing dir which I could create wherever? I'd only like to load that css file, and the js files located there.
Is there a path variable I can use to point directly to that dir rather than the regular $styles ? I don't want any navigation, logo, or header/block info from the regular drupal install...just plain flat pages?
Thanks in advance,
Mark
Comments
Hi sir, you can create new
Hi sir, you can create new template file.
for example you have this path:
http://www.example.com/landing
Then create a template file "page-landing.tpl.php", this is the first template file that the system will look for if this not found page.tpl.php will be called.
Inside your "page-landing.tpl.php" in the head section you may want to use drupal_add_css() or drupal_add_js() to load specific styles or scripts you want instead of the available variables like "$styles which import all CSS files for the page. and $scripts load the JavaScript files and settings for the page".
example:
sorry for my english.
hope this helps.
Thanks so much
I appreciate you making the time for a clear answer! In terms of the 'directory path' is this relative to drupal root, or can it live outside of the drupal path and pointed to explicitly?
Mark
if your asset.css .js is
if your asset.css .js is outside drupal or you host it in other host you can use absolute path
example:
if you css or js file live inside drupal you can use drupal_get_path();
this will gives you path: "sites/all/themes/mythemename/myassets/asset.css"
see drupal_get_path documentation http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_ge...
thanks,
Darryl
$directory
You can also use variables
drupal_add_css($directory . "/myassets/asset.css");But, the question not resolved yet is: Can I use only my css ?
I customized my front page in drupal 7, creating "page--front.tpl.php" (in 6 is only 1 hyphen page-front.tpl.php). When I see my front page html generated code and I see links to all css files. I would only use my css file
Hi Sir I am not really good
Hi Sir I am not really good in theming and also new in drupal, and I am just sharing my idea.
With regards in the question: "Can I use only my css ?"
It is also depends in your theme structure.
Like for example in bartik theme in drupal 7. If I have path like http://www.example.com/etc then I want to only load one css file for example my asset.css in that specific path, then since the < head > section of the bartik theme is not located in the page.tpl.php and I made page--etc.tpl.php this will take no effect since the < head > section of bartik theme which loads all the styles and scripts - is located in modules/system/html.tpl.php, this was stated in page.tpl.php of bartik theme.
And so in order to take effect our goal which is loading only my desire css file, then I have to copy the html.tpl.php file from modules/system folder and paste it inside the bartik template and rename it to:
html--etc.tpl.php and inside the < head section > I will only put my asset.css using drupal_get_css() and it should work now.
sorry again for my poor english.
Thanks,
Darryl