S
S
sabanovvv2014-12-24 20:46:49
PHP
sabanovvv, 2014-12-24 20:46:49

How to edit node.tpl.php?

I'm making my own website, I'm still learning.
I'm using the bootstrap theme.
I need to add a button to switch to the next / previous material in the node (material), but there is no node.tpl.php in the topic.
What should I do?
here are screenshots of the theme
folder joxi.ru/a2XeNj9I1MBJAg
joxi.ru/4AkO6XnUybpBAq
joxi.ru/Dr8nYzBT4ja626
this code was supposed to be inserted into node.tpl.php

<div class="pagination-work">
       <?php print render($title_suffix); ?>
          <?php $next = next_page_link($node);
                $previous = previous_page_link($node); ?>
        <?php if($previous !== false): ?>
                <a href="<?=$previous; ?>" class="previouslink"><span class="arrow left">&lt; </span> Предыдущ |</a>
        <?php endif; ?>
        <?php if($next !== false): ?>
                <a href="<?=$next; ?>" class="nextlink">След <span class="arrow">&gt;</span></a>
        <?php endif; ?>
  </div>

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Y
Yustas Alexu, 2014-12-24
@Yuxus

If there is no file in the theme, it is copied into the theme from Drupal core. For example node.tpl.php is copied from /modules/node/node.tpl.php folder.
You can read more details here: ramech.net/courses/drupal7-theming/theme-node.tpl....
PS By the way, you created the theme incorrectly - there is bootstrap_subtheme in the theme folder. It needs to be copied to the theme folder and edited. You don't need to touch bootstrap itself. When you update a theme, your changes will be lost.

D
Dmitry Entelis, 2014-12-24
@DmitriyEntelis

So you have a theme in which the file containing what you expect to see in node.tpl.php is called something else.
Open the source, read what is written in the files, determine which file you need.

D
Dmitry Kamyannoy, 2014-12-26
@redfieldone

Take the node file of the system module and drop it into the theme/system folder. Update cache and prooffit.
I can't stand this thread, there's so much stuff in it...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question