By riccardogalli on
Hello. I'm doing a website with drupal 6. i'm using millex theme, a commercial theme which has a beautiful flash slideshow (.swf), but unfortunately the slide appears on all pages. Does anyone know give me directions on how to make it appear only on the frontpage? Thanks a lot for your help.
Comments
^
Did you checked if the flash animation is in a block ?
Admin > Build > Block page ?
If yes, you can add page-specific visibility rules to the block.
If SWF is not there, and Panels module is not used, most likely that it's embeded in page.tpl.php file.
What's new and changing in PHP 8.4
no is not a block, in fact is
no is not a block, in fact is in page.tpl.php
How can i make visible only in the homepage?
thanks a lot you save my life :)
^
1. Set admin theme to Garland.
2. Copy page.tpl.php to front.tpl.php
3. Remove the above code from page.tpl.php
//page.tpl.php is the general template for pages, and page-front.tpl.php will be used only in front page.
But most likely that this will screw up your site's layout. So if you got any error, you can undone it and access admin pages from /admin page. these pages will use Garland theme.
What's new and changing in PHP 8.4
i have not front.tpl.php
ok, I will use the method you have indicated, the problem is that I have not the page called front.tpl.php. In the theme folder there: box, block, comment, node, page, template. Tpl.php and nothing more. How can I do?
I tried to create a new front.tpl.php page and do that you have recommended, but not working.
^
Create a new page-front.tpl.php and copy contents of page.tpl.php to it. Sorry for not being too specific.
What's new and changing in PHP 8.4
done, but no results
I already did. the result is that the flash slideshow is no longer seen around the site, even on the homepage
embedding swfobject
This might help .. instead of embedding swf in place of logo (as in the thread below) put the block in
http://drupal.org/node/1043550
Another way .. perhaps easier to test .. is to create a block with an iframe pointing to the swf file (running somewhere on your host or an external host).
..
the problems are: this slideshow is not place in logo area, and there is no areas in block section which to put a block with the slide inside.
embedding swfobject
This double post was in error (I was trying to correct a typo).
As I explained you don't need
As I explained you don't need to place the swfobject in logo container .. that was an example .. the principles apply for any container.
Here is the Iframe approach .. I'll post the other solution later ..
Go to Administration > Configuration > Content Authoring > text formats
Add text format
Name: Adminonly iframe
Roles: administrator only (for security)
Enabled filters: tick "Limit allowed HTML tags"
In "Allowed HTML Tags" field > add .. < iframe >
Save configuration
================================
download swfobject_2.2 and place in a convenient location on your server
http://code.google.com/p/swfobject/
e.g. http://localhost:8080/swfobject
or you might put it in /sites/all/files/swfobject
================================
go to Administration > Structure > Blocks
add block
create newly created text format > Adminonly Iframe
Block description > embed swfobject
Block title > leave empty
Block body
Region Settings
choose where you want the swfobject to be embedded.
e.g. I have Marinelli (default theme) in Content region
Optionally you can use the field "Show block on specific pages" (e.g. <front>)
Save block
I think you should be able to
I think you should be able to create a new block, with the input method of PHP code. Then simply paste this code into the block:
Now you can add the block to a section of the page through the interface and specify that it will appear only on the homepage in the block configuration. You may also need to add styles to get it to appear on the page exactly where you want. You can do that by wrapping the block in:
You can now set the css for the class in your stylesheets to move the slideshow to the header.
You would also need to remove the code from page.tpl.php to keep it off all the other pages.
^
And consider using relative paths to save some microseconds of load time.
What's new and changing in PHP 8.4
no sections..
First thanks to all, is my first post and as you know I am a beginner and not a programmer. I'm still willing to throw myself into this thing by following your instructions. Just one question: This block, created with the code that runs inside the slide, go through the interface located in a region of the site as all the blocks. But in the block's page there isn't the correct region where to place it. In that zone of the site I see just sidebars and content area. Nothing showcases area, main area of the top, nothing..
following you..
I followed your instructions and created the block with the slide inside. I do not know how to put it in the right position, the space under the head.
"You can now Set The css for the class in your stylesheets to move the slideshow to the header.
Also you need to remove Would the code from page.tpl.php to keep it off all the other pages. "
This is the part that I miss. Can you help me?
You can put it in one of the
You can put it in one of the sections that isn't being used and it probably won't start in the exact position you want it in. But by editing the Stylesheets, you have the power to move it around the page. say you put it in a section called "over-content" but it is appearing too low on the page. You can fix this by wrapping the entire block in a class according to how I said. Something like this:
Then open a css stylesheet '/sites/all/themes/CURRENT_THEME/css/styles.css'. Add this to the bottom of the text file.
Then save the file and reload your page. You can see the slideshow move up on the page this way and position it where you want manually. Also, if you download firebug it will help in this process. Good luck!