Author Topic: 4images 1.7.4 - how to change header (header) template for details.php (auch de  (Read 8485 times)

0 Members and 1 Guest are viewing this topic.

Offline Romson

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Hi,

i nee another header templatge in details.php, how i can make this ? The header2.html template is ready but i dont know how script it in the php code. I try to change {header} to {header2} but this dont work.



<<<< Deutsch >>>>

ich brauche ein anderes header  template für die details.php page. Das Template ist fertig (header2.html) aber ich weis nicht wie ich den php code verändern muss damit das  template in der details.php benutzt wird. Hab versucht einfach {header} durch {header2} zu ersetzten aber das funktioniert nicht.

jemand ne idee ?

Offline Romson

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
???   :(

Offline Romson

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
ok, habs selbst gefunden

wer auch anderen header für die details page braucht

1)

erstelle in deinem template verzeichnis ein neues header template mit dem namen header2.html

2)

suche in template.php ( includes/template.php) nach diesen code:

Code: [Select]
function print_template($template) {
    if (strpos($template, $this->start.'header'.$this->end) !== false) {
      $header = $this->parse_template("header");
      $template = str_replace($this->start.'header'.$this->end, $header, $template);
    }

und füge direkt drunter das hier ein:

Code: [Select]
if (strpos($template, $this->start.'header2'.$this->end) !== false) {
      $header2 = $this->parse_template("header2");
      $template = str_replace($this->start.'header2'.$this->end, $header2, $template);
    }

3)

änder in details.html {header} in {header2}


das wars

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Hallo,

das geht aber auch viel einfacher  :wink:
Und besser, falls ein Update der php Scripte erfolgt

in details.html einfach ganz oben den kompletten Quelltext der header.html einfügen.

Natürlich vorher {header} entfernen.
Nach dem Einfügen des neuen Header können hier seperat zu der normalen header.html  Änderungen durchgeführt werden.

Gruß
KUrt

Offline didoman

  • Newbie
  • *
  • Posts: 32
    • View Profile
English Translation


1)

Create your own header2.html and put it in the your templates folder

2)

Find the code below in template.php  (includes/template.php)

function print_template($template) {
    if (strpos($template, $this->start.'header'.$this->end) !== false) {
      $header = $this->parse_template("header");
      $template = str_replace($this->start.'header'.$this->end, $header, $template);
    }

Now add the following code below it. You will see that you are just adding another template, in this case it is for header2

if (strpos($template, $this->start.'header2'.$this->end) !== false) {
      $header2 = $this->parse_template("header2");
      $template = str_replace($this->start.'header2'.$this->end, $header2, $template);
    }

3)

Now you can change in details.html  {header} to {header2}

You can add unlimited headers or footers, just repeat the process, and replace the appropriate {header*} in any page you want.

www.didoman.com