Handbook says: "For Danland 6.x-2.x, after renaming the page-front.tpl.php to page.tpl.php then you must change the code in template.php"

There is no page-front.tpl.php in 7.x so what file has to be renamed? Changing the code in template.php doesn't work.

Comments

seaurchin’s picture

Version: 7.x-1.0-rc2 » 7.x-1.0-beta2
danpros’s picture

Hi,

You should upgrading Danland to RC2 :)

The Drupal 7 version of Danland is a little different, you can creating that by removing the following line in page.tpl.php:

<?php if($is_front): ?> <!-- remove this -->
<div id="slideshow-wrapper">
................
</div>
<?php endif; ?> <!-- and remove this -->

The rest is like on D6 of Danland.

Dan

seaurchin’s picture

Version: 7.x-1.0-beta2 » 7.x-1.0-rc2

Using rc2 with a fresh template.php and page.tpl.php, I tried your suggestion with the default slideshow a few times, but no luck.

Every time the slideshow disappears completely and a black, graded shadow appears instead, which obscures the bottom of each section of main content.

(The only other change I have made is using the Superfish Drop Menu very successfully, and this is still working fine.)

This is a stunning and versatile theme and it would be great to have the option of a slideshow banner on each page.

Thanks for your input.

danpros’s picture

Hi,

I think you are missing somethings here. The page.tpl.php code must become like this

<div id="slideshow-wrapper">
<div class="slideshow-inner">
<div id="slideshow-preface">
 <?php if ($page['preface']): ?>
          <div id="preface">
            <?php print render ($page['preface']); ?>
          </div><!-- end preface -->
 <?php endif; ?>
</div>
<?php if ($page['highlighted']) : ?><div id="slideshow-bottom">
<div id="mission"><?php print render ($page['highlighted']); ?></div></div><?php endif; ?>
<div class="slideshow">
<img src="<?php print $base_path . $directory; ?>/images/slideshows/sea.jpg" width="950" height="355" alt="slideshow 1"/>
<img src="<?php print $base_path . $directory; ?>/images/slideshows/noon.jpg" width="950" height="355" alt="slideshow 2"/>
<img src="<?php print $base_path . $directory; ?>/images/slideshows/snow.jpg" width="950" height="355" alt="slideshow 3"/>
</div>
</div>
</div>

Dan

seaurchin’s picture

Status: Active » Closed (fixed)

Got it! The problem was that I deleted the wrong ?php endif; ?> on Line 78, which caused the shadowing.

Your example showed me that it was line 93 that needed to be deleted.

Hope this helps someone else and many thanks for your support.

It works beautifully!

seaurchin’s picture

Status: Closed (fixed) » Active

I see that the changing images of the slideshow show only on the first page, while the other pages show only a the first static image. Is there a way around this?

danpros’s picture

Hi,

You forgot to change this in template.php

if (drupal_is_front_page()) {
  drupal_add_js(drupal_get_path('theme', 'danland') . '/scripts/jquery.cycle.all.js');
}

to this

drupal_add_js(drupal_get_path('theme', 'danland') . '/scripts/jquery.cycle.all.js');

Dan

seaurchin’s picture

Status: Active » Closed (works as designed)

Thank you very much, Dan. I'll close this one for you.

etcbbu’s picture

I'm using Danland 7.x-1.0 (default theme).

I'm having trouble understanding, on this topic, what exactly needs to be changed in order for the slideshow to chow on every page. Do I need to edit

page.tpl.php

or

template.php?

etcbbu’s picture

Is this topic still active at all? I'm trying to figure out how I can place the Danland slideshow on all pages of my website..?

Edy Gorbacev’s picture

you should see from the top first and check one by one their conversation. its already clear by dan's statement.

Oke.. Il explain it one more time :)

First: Open your page.tpl file at danland folder theme,
there is a code start with
<?php if($is_front): ?>
delete that statement.. next scroll down again..
and you will see the end of "IF" statement like this
<?php endif; ?>
delete that too.. and save your page.tpl

NEXT..

open another file named template.php in the same folder as your page.tpl file in danland folder theme:

Look at the bottom of the script.. there is:

if (drupal_is_front_page()) {
  drupal_add_js(drupal_get_path('theme', 'danland') . '/scripts/jquery.cycle.all.js');
}

now.. after you found it.. than delete it and add new like these:

drupal_add_js(drupal_get_path('theme', 'danland') . '/scripts/jquery.cycle.all.js');

done.. and dont forget to CLEAR YOU CHACE before you can see your change.. (or maybe not :D just in case)

If you patient and read it carefully you will find what you want.. :D

etcbbu’s picture

I am sorry--I was confused because people were talking about various versions of the module and stuff, and I couldn't tell which of those two tasks needed to be done in this-and-this version, or which one/ones of the task needed to be done in that-and-that version. And I *did* do that first step, which was the

First: Open your page.tpl file at danland folder theme,
there is a code start with
if($is_front):
delete that statement.. next scroll down again..
and you will see the end of "IF" statement like this
endif;
delete that too.. and save your page.tpl

And it didn't exactly work, heh, because it just made a blank square and the little shadow on my site; I neglected to do that second step with template.php, and was unsure what I was supposed to do.

Thank you for the post--I will do that, I appreciate it.

--etcbbu

etcbbu’s picture

It did not work for me :-/ Here is my site:

http://tales-central.com/drupal

On the page.tpl, when I am supposed to find

<?php if($is_front): ?>
and
<?php endif; ?>

I did that! I found them both and deleted them!

Now, in page.tpl it also finds

<?php if($is_front): ?>

again--am I supposed to delete it in this spot? Here is an image of what I am talking about:

http://tales-central.com/drupal/pagetpl.png

And here is what my page.tpl file looks like, in the area where I am supposed to delete the two statements. Please tell me if it looks right:

http://tales-central.com/drupal/pagetplright.png

And here is what my templates.php file looks like where I was supposed to do the replacing of statements. Please tell me if it looks right:

http://tales-central.com/drupal/templateright.png

etcbbu’s picture

Sorry--I mis-posted those images a moment ago. The links are correct now.

Edy Gorbacev’s picture

o.. oo.. you delete the wrong line

open again your page.tpl file (before you add new line etc..)
and go to line 70

now.. here is the scrip from line 68:

<div style="clear:both"></div>

<?php if($is_front): ?> /*<<<<<<<<<<<<<<<<<<<blockquote>First.. delete this.. </blockquote> */
<div id="slideshow-wrapper">
<div class="slideshow-inner">
<div id="slideshow-preface">
 <?php if ($page['preface']): ?>
          <div id="preface">
            <?php print render ($page['preface']); ?>
          </div><!-- end preface -->
 <?php endif; ?>
</div>
<?php if ($page['highlighted']) : ?><div id="slideshow-bottom">
<div id="mission"><?php print render ($page['highlighted']); ?></div></div><?php endif; ?>
<div class="slideshow">
<img src="<?php print $base_path . $directory; ?>/images/slideshows/sea.jpg" width="950" height="355" alt="slideshow 1"/>
<img src="<?php print $base_path . $directory; ?>/images/slideshows/noon.jpg" width="950" height="355" alt="slideshow 2"/>
<img src="<?php print $base_path . $directory; ?>/images/slideshows/snow.jpg" width="950" height="355" alt="slideshow 3"/>
</div>
</div>
</div>
<?php endif; ?> /* <<<<<<<<<<<<<<<<<<<<<<<<<<< <blockquote>and this </blockquote> */

 <?php if($page['preface_first'] || $page['preface_middle'] || $page['preface_last']) : ?>
    <div style="clear:both"></div>

beside that code.. even there is another line called the same if($is_front): , just leave it.

etcbbu’s picture

Thanks so much--works like a charm!

Edy Gorbacev’s picture

nice to hear that .. :)
this theme very easy to costumize... go for it..!!

etcbbu’s picture

I'm getting the problem that seaurchin mentioned, where the slideshow scrolls through images on the front page, but not on the rest of the pages. They just show a static image.

I'm pretty sure that my page.tpl.php file is fine and good, and changed how it needs to be.

But now with my template.php file, I tried to change it from being this way:

http://tales-central.com/drupal/templateasis.jpg

to making it look like this:

http://tales-central.com/drupal/templatechange.jpg

But then when I tried to go to my site, I just got a php error and my site wouldn't load at all. It said I had an error in template.php on a certain line.

What am I doing wrong? I took the statement you said earlier, which was:

if (drupal_is_front_page()) {
  drupal_add_js(drupal_get_path('theme', 'danland') . '/scripts/jquery.cycle.all.js');
}

to this

drupal_add_js(drupal_get_path('theme', 'danland') . '/scripts/jquery.cycle.all.js');

And, basically, as you can see with those images I posted, I just deleted the

if (drupal_is_front_page()) {

in line 29, but that seems to have created an error.

What did I do wrong? What exactly needs to be changed in template.php?

etcbbu’s picture

So, was I wrong? All I did in template.php was delete

if (drupal_is_front_page()) {
  drupal_add_js(drupal_get_path('theme', 'danland') . '/scripts/jquery.cycle.all.js');
}

Was that the wrong thing to do?

etcbbu’s picture

...wow. Literally the only problem was that I did not delete the very last character in the template.php script, which was the end curly bracket character. I deleted that, and all is well now.

Thanks for this topic, y'all--it really was helpful for me; both in reading the history of other peoples' asking about this before, and then my own questions' being answered.

boefie’s picture

How to displaying the banner on all pages except one ?
I try with if ($node == 'pagename') {
image 1
image 2
} else {
image 3
image 4
}
endif
But the variable $node was unknown

Is there an solution ?

joshua.rosaaen’s picture

How can I display a different banner for each page in the Danland theme? I have a product line that I would like to have different banners for and am trying to utilize as much theme as possible...but I am stuck on being able to make the page display different banner than front page one. I am new to Drupal and would really like some help on this...suggestions please. I am not seeing any differentiation between pages and I would like to be able to do that if its possible...some links on where I can learn this would be helpful since I do have 3 other page types I would like to apply this line of thinking to...I am thinking that I can use the (name)--tbl.php file for each page I want to apply a banner to but I am not sure how best to implement this...again I am a newbie...so please go easy on me. LOL!!! Thanks in advance

irene_’s picture

How can I display a different banner for each page in the Danland theme? It seems that it isn't a response for the last post.
Thank you!

bgrega’s picture

I'm running Drupal 7, I have made the changes to the following files per your directions, however, I get nothing on my other pages, I have cleared my cache through drupal and my browser. Any suggestions. Here is the code I changed. Thanks. Oh, I am quite the Newbie also.

my page.tpl.php:

<!-- <?php if($is_front): ?> -->

<!--Added by Bryan to change slideshow delay-->

<script type="text/javascript">
jQuery(document).ready(function($) {
$('.slideshow').cycle({
fx: 'fade' , timeout: 4000, delay: 1000});
});</script>

<!--Added by Bryan to change slideshow delay-->

<div id="slideshow-wrapper">
<div class="slideshow-inner">
<div id="slideshow-preface">
 <?php if ($page['preface']): ?>
          <div id="preface">
            <?php print render ($page['preface']); ?>
          </div><!-- end preface -->
 
<?php endif; ?>

</div>
<?php if ($page['highlighted']) : ?><div id="slideshow-bottom">
<div id="mission"><?php print render ($page['highlighted']); ?></div></div><?php endif; ?>
<div class="slideshow">
<img src="<?php print $base_path . $directory; ?>/images/slideshows/T1.jpg" width="950" height="205" alt="slideshow 1"/>
<img src="<?php print $base_path . $directory; ?>/images/slideshows/T2.jpg" width="950" height="205" alt="slideshow 2"/>
<img src="<?php print $base_path . $directory; ?>/images/slideshows/T3.jpg" width="950" height="205" alt="slideshow 3"/>
<img src="<?php print $base_path . $directory; ?>/images/slideshows/T4.jpg" width="950" height="205" alt="slideshow 4"/>
</div>
</div>
</div>

<!-- <?php endif; ?> -->

and my template.php:

<?php
// $Id: template.php,v 1.10.4.3 2010/12/14 03:30:39 danprobo Exp $
function danland_page_class($sidebar_first, $sidebar_second) {
	if ($sidebar_first && $sidebar_second) {
		$id = 'layout-type-2';	
	}
	else if ($sidebar_first || $sidebar_second) {
		$id = 'layout-type-1';
	}

	if(isset($id)) {
		print ' id="'. $id .'"';
	}
}

function danland_preprocess_html(&$vars) {
  // Add conditional CSS for IE6.
drupal_add_css(path_to_theme() . '/style.ie6.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'IE 6', '!IE' => FALSE), 'preprocess' => FALSE));
}

function danland_preprocess_maintenance_page(&$variables) {
  if (!$variables['db_is_active']) {
    unset($variables['site_name']);
  }
  drupal_add_css(drupal_get_path('theme', 'danland') . '/maintenance.css');
  drupal_add_js(drupal_get_path('theme', 'danland') . '/scripts/jquery.cycle.all.js');
}

drupal_add_js(drupal_get_path('theme', 'danland') . '/scripts/jquery.cycle.all.js');

supermatso’s picture

Ladies and Gentlemen where do i get the download link for the 7.x-1.0-rc2,I have tried removing the lines as suggested on this forum but i quess is failing because i have not upgraded to the RC2 please i need the link.
Thank you

kazar’s picture

"rc" means "release candidate" for the version. "rc2" means "the second release candidate for the version".

Therefore, "7.x-1.0-rc2" would have been the 2nd release candidate for 7.x-1.0. Therefore the current actual release, 7.x-1.0, is a later version than it's release candidates. Going back to an rc version would be a downgrade, not an upgrade.

You'll notice that comments referring to "rc2" are dated December, 2010. The actual release version (7.x-1.0) is dated January 11, 2011. Any successful changes made in the rc's would be included in this release version.

There is some other reason why you are having trouble, then. Sorry I can't help with that part, but I hope this info is useful to you anyway.

kazar

supermatso’s picture

Thank you Kazar, it makes perfect sence.The problem i have is to display the slideshow module on all pages for the Danland theme, i have tried all the options mentioned here but they break the theme

eeric49’s picture

Thank you for the grate solution for a slideshow on all pages. This is one thing that makes danland the best theme.
Once again for those who have not managed to get it working
template.php..do the following

//if (drupal_is_front_page()) {
drupal_add_js(drupal_get_path('theme', 'danland') . '/scripts/jquery.cycle.all.js');
//}
page.tpl.php
delete the following..

if($is_front):
endif;
check it out here..
kenia safaris

Xagarsan’s picture

Project: Danland » Creative Theme
Version: 7.x-1.0-rc2 » 7.x-1.0

Thank you for the solution

Xagarsan

501sttrooper’s picture

eeric49 -

I have the most up to date version of Drupal and Danland. Tried your suggestion with template.php and page.tpl.php and couldn't get it to take. When you say "delete the following", were you saying get rid of everything in the page.tpl.php file or perhaps specific lines? Still testing and wanted to see if you had any other suggestions. Thanks!

501sttrooper’s picture

Figured it out after re-reading...patience is a virtue that I sometimes lack ;)

tmwpnpnpnp’s picture

Thanks Guys this one was very helpful!

b4comic’s picture

thanks guys.....

grkm2002’s picture

Title: Displaying the banner on all pages in 7.x » views slideshow pager for banner not visible
Status: Closed (works as designed) » Active

I am using drupal 7 version of the theme. I've add a slideshow region to danland.info and updated my page.tpl.php. I am able to get a views slideshow to appear and when not using the views slideshow the original slideshow comes back. However, I am unable to get my pager to show up at the bottom of the views slideshow on the frontpage banner.
What am I doing wrong? This is how my page.tpl.php looks

	<?php if($is_front): ?>
		<div id="slideshow-wrapper">
			<div class="slideshow-inner">
				<?php if ($page['preface']): ?>
					<div id="slideshow-preface">
						<div id="preface">
							<?php print render ($page['preface']); ?>
						</div> <!-- end preface -->
					</div>
				<?php endif; ?>
				<?php if ($page['highlighted']) : ?>
					<div id="slideshow-bottom">
						<div id="mission">
							<?php print render ($page['highlighted']); ?>
						</div>
					</div> <!-- end mission / highlighted -->
				<?php endif; ?>
						<?php print render ($page['slideshow']); ?>
					</div> <!-- end slideshow -->
	<div id="slide-pager-wrapper">
		<div id="slide-pager"></div>
	</div>
				<?php endif; ?>
				<?php if (!$page['slideshow']) : ?>
					<div class="slideshow">
						<img src="<?php print $base_path . $directory; ?>/images/slideshows/sea.jpg" width="950" height="355" alt="slideshow 1"/>
						<img src="<?php print $base_path . $directory; ?>/images/slideshows/noon.jpg" width="950" height="355" alt="slideshow 2"/>
						<img src="<?php print $base_path . $directory; ?>/images/slideshows/snow.jpg" width="950" height="355" alt="slideshow 3"/>
					</div> <!-- end slideshow -->
	<div id="slide-pager-wrapper">
		<div id="slide-pager"></div>
	</div>
				<?php endif; ?>
			</div>
		</div>
	<?php endif; ?>
andreacb’s picture

Issue summary: View changes

For drupal 7:
My small contribution for ones who may want to have slideshow displayed only in selected pages.
In my case, it's a multi language small site with a number of 'home' pages (thus, with not hust a front page but one for each language)
To solve this need, you simply need to add a test on the page.tpl.php replacing the stardard one.
From:
if($is_front):

To (for example):
if (stripos(drupal_lookup_path('alias',current_path()),"home")!==FALSE):

In this example the name of the pages which are to display the slide show have 'home' as part of their URI alias.

Hope it helps.

andreacb’s picture

You may want to change template.php as well.
From

if (drupal_is_front_page()) {
    drupal_add_js(drupal_get_path('theme', 'danland') . '/scripts/jquery.cycle.all.js','cache=FALSE');

to (for example):

if (stripos(drupal_lookup_path('alias',current_path()),"home")!==FALSE) {
    drupal_add_js(drupal_get_path('theme', 'danland') . '/scripts/jquery.cycle.all.js','cache=FALSE');
danpros’s picture

Project: Creative Theme » Danland
tryitonce’s picture

I came back to this thread with the problem of banners not rotating on pages other than the front page.
The thread gave me the answer within the first few comments.
It occurred to me that the advice to delete parts of the code in the page.tpl.php and the template.php might not be the best help, especially for the occasional coder.
We prefer to comment out the unwanted code and can thus follow exactly what we did or did not do at the time:
Thus the changes look like this:
page.tpl.php
To the lines to be commented out we add the !-- after the < and -- before the ending >. The lines to be "dropped" change from

<?php if($is_front): ?>
.....................
<?php endif; ?>

to
<!-- ?php if($is_front): ? -->
.....................
<!-- ?php endif; ?-->
You can see the effect alreday in the text editor here - the active php code above needs to be but into the "<-code-> ... <-/code->" tags. The lines with the commenting out characters do not need them.

The complete entry looks like this:

<!-- ?php if($is_front): ? -->
<div id="slideshow-wrapper">
<div class="slideshow-inner">
<div id="slideshow-preface">
 <?php if ($page['preface']): ?>
          <div id="preface">
            <?php print render ($page['preface']); ?>
          </div><!-- end preface -->
 <?php endif; ?>
</div>
<?php if ($page['highlighted']) : ?><div id="slideshow-bottom">
<div id="mission"><?php print render ($page['highlighted']); ?></div></div><?php endif; ?>
<div class="slideshow">
<img src="<?php print $base_path . $directory; ?>/images/slideshows/1_s_950x200.jpg" width="950" height="200" alt="slideshow 1"/>
<img src="<?php print $base_path . $directory; ?>/images/slideshows/2_s_950x200.jpg" width="950" height="200" alt="slideshow 2"/>
<img src="<?php print $base_path . $directory; ?>/images/slideshows/3_s_950x200.jpg" width="950" height="200" alt="slideshow 3"/>
<img src="<?php print $base_path . $directory; ?>/images/slideshows/4_s_950x200.jpg" width="950" height="200" alt="slideshow 4"/>
<img src="<?php print $base_path . $directory; ?>/images/slideshows/5_s_950x200.jpg" width="950" height="200" alt="slideshow 5"/>
</div>
</div>
</div>
<!-- ?php endif; ?-->

In this example the banners (slides) are numbered 1-5 (plus an index for project and size _s_950x200.jpg). We then just change these five images from time to time. For one project we hold images in 4 folders for the four seasons and change the set when the time comes. Each folders holds slides with exactly the same name, but (obviously) different images.
---------
template.php - the commenting out is a little different and simpler - all you need are two //:

if (drupal_is_front_page()) {
  drupal_add_js(drupal_get_path('theme', 'danland') . '/scripts/jquery.cycle.all.js');
}

becomes

//if (drupal_is_front_page()) {
  drupal_add_js(drupal_get_path('theme', 'danland') . '/scripts/jquery.cycle.all.js');
//}

And if you use a developers text editor it will show the changes by changing the colour of the lines commented out helping you to see what happened and what might be missing - we use PSPad under Windows and Sublime, GNU Emacs 24, Geany or similar under Linux.
...

bozzochet’s picture

Ciao,

I feel my self very stupid...

I installed Danland (taking from here https://www.drupal.org/project/danland , so I'm quite sure is the last release...) on my Drupal 8.7.3.

I try to follow https://www.drupal.org/node/768350 but there's no single file or line of code that is equal to the handbook. Some of them are similar and I was able to customize something enabling and using the local.css file, but part of them are completely different or however not working.

I'm trying to have the slideshow banner on all the page (not only the front one). Following this post and also other I edited:

themes/danland/templates/block--system-branding-block.html.twig
themes/danland/templates/page.html.twig

in particular like this:

<!--      {% if is_front %} -->
        <h1 class="site-name">
          <a href="{{ path('<front>') }}" title="{{ site_name }}">{{ site_name }}</a>
        </h1>
<!--      {% else %}
        <h2 class="site-name">
          <a href="{{ path('<front>') }}" title="{{ site_name }}">{{ site_name }}</a>
        </h2>
      {% endif %} -->

(removing the "front" if and the else case)

<!--  {% if is_front %} -->
    <div id="slideshow-wrapper">
      <div class="slideshow-inner">
        {% if page.preface %}
          <div id="slideshow-preface">
            <div id="preface">
              {{ page.preface }}
            </div><!-- end preface -->
          </div>
        {% endif %}
        {% if page.highlighted %}
          <div id="slideshow-bottom">
            <div id="mission">{{ page.highlighted }}</div>
          </div>
        {% endif %}
        {% if page.slideshow %}
          <div class="custom-slideshow">
            {{ page.slideshow }}
          </div>
                {% else %}
          <div class="slideshow">
            {% for file in files %}
              <img src="{{ file.uri }}" width="100%" height="100%" alt="{{ file.name }}"/>
            {% endfor %}
          </div>
        {% endif %}
      </div>
    </div>
<!--  {% endif %} -->

(so commenting the "front" if).

These are similar to the 'proposed' changes to page.tpl.php (that I do not find...) but however I didn't notice any change to the website. On the contrary I'm not able to find the template.php file or any other file with something similar to

if (drupal_is_front_page()) {
  drupal_add_js(drupal_get_path('theme', 'danland') . '/scripts/jquery.cycle.all.js');
}

Where I'm wrong?

Thanks,
Matteo