Autor Zpráva
Ivorius
Profil
Tak mam zde dalsi problem. Nevite jak dosáhnout toho, aby textpattern delal hezke odkazy?
thingwath
Profil
Je pro to nabídka v administraci?
Ivorius
Profil
jo, můžu si to tam nastavit
victor_vega
Profil *
TEXTPATTERN HELP

URL Mode

Governs how permanent links to archived articles will appear.

?=messy mode is the most straightforward; it will work without you having to do much mucking about. In this mode URLs for archived articles on your site will look like this:
http://www.yoursite.com/index.php?id=123

/clean/ mode is a little trickier, but it makes URLs that are elegant and easier to remember. Here are the steps to make /clean/ mode work:

You must have ‘Use sections’ set in Site Preferences

Your site must be on a Unix-based server running Apache, or on a Windows server running PHP as an Apache module

For every section you have on your site (including the default section called ‘article’), place a text file with the exact same name in your root web directory, containing the following bit of code, replacing SECTION_NAME with the section’s actual name:

<?php
include "./textpattern/config.php";
$s = "SECTION_NAME";
include $txpcfg["txpath"]."/publish.php";
textpattern();
?>

Next, with a text editor create or open an existing file in your web root called .htaccess and paste the following inside:

<Files SECTION_NAME>
ForceType application/x-httpd-php
</Files>

again, replace SECTION_NAME with the section’s actual name.

Once you select /clean/ url mode in Site Preferences, your permanent link urls will look more familiar:
http://www.mysite.com/article/123/
Ivorius
Profil
hezké a teď česky
thingwath
Profil
Ten vtip je v tom, že když chceš mít URL třeba

http://www.example.com/clanky/o_svete

tak si vytvoříš soubor clanky do kterého umístíš uvedený PHP kód (nahraď SECTION_NAME). Pak musíš zajistit aby prošel PHP parserem. K tomu je ten záznam do .htaccess, ale to musí mít povolené hosting, jinak je nutné otravovat admina.
Ivorius
Profil
Návod na textpattern
Toto téma je uzamčeno. Odpověď nelze zaslat.

0