Dokumentace k pluginu 'Statické stránky'
(serendipity_event_staticpage)

Dokumentaci k tomuto pluginu přeložil do češtiny Vladimír Ajgl (vlada [zavinac] ajgl [tecka] cz) dne 4.5.2013. Od té doby mohl být plugin pozměněn nebo mohly být rozšířené jeho funkce. Zkontrolujte pro jistotu i aktuální anglickou dokumentaci, ChangeLog, README_FOR_RELATED_CATEGORIES.txt, Smarty_and_CSS_Tags a TODO.

Popis pluginu

Zobrazuje v blogu statické stránky se stejným designem jako mají běžné přspěvky. Přidá nové menu do adminstrátorského rozhraní.

Vypsání odkazů na související statické stránky ve výpisu kategorií

Podívejte se na šalbony staticpage-entries-listing.tpl a plugin_staticpage_related_category.tpl!

Aby se ve výpisu kategorie zobrazovaly i související statické stránky, přidejte následující kód do šablony entries.tpl:
(můžete použít {$CONST.PLUGIN_STATICPAGELIST_FRONTPAGE_LINKNAME} místo {$blogTitle})

{if ($view == 'archives') || ($view == 'frontpage')}
    <table border="0" cellpadding="2" cellspacing="2" class="staticpage_navigation">
        <tr>
              <td class="staticpage_navigation_left">»

              <a href="{$serendipityBaseURL}">{$blogTitle}
              » {$CONST.ARTICLE_OVERVIEW}
        </tr>
    </table>
{/if}

{if ($view == 'categories')}
    <<able border="0" cellpadding="2" cellspacing="2" class="staticpage_navigation">
        <tr>
              <td class="staticpage_navigation_left">»

              {if $staticpage_categorypage}
              <a href="{$staticpage_categorypage.permalink}">{$staticpage_categorypage.pagetitle}
              {else}
              <a href="{$serendipityBaseURL}">{$blogTitle}
              {/if}
              » {$CONST.ARTICLE_OVERVIEW}
        </tr>
    </table>
{/if}

Seznam použitých CSS tagů a Smarty proměnných

Proměnné Smarty

bool $staticpage_articleformat
string $staticpage_articleformattitle
string $staticpage_headline
array $staticpage_navigation
string $staticpage_navigation.prev.link
string $staticpage_navigation.prev.name
string $staticpage_navigation.top.link
string $staticpage_navigation.top.name
string $staticpage_navigation.next.link
string $staticpage_navigation.next.name
string $staticpage_pass
string $staticpage_form_pass
string $staticpage_form_url
array $staticpage_extchildpages
string $staticpage_extchildpages[i].image
string $staticpage_extchildpages[i].permalink
string $staticpage_extchildpages[i].precontent
string $staticpage_author
timestamp $staticpage_lastchange
array $staticpage_adminlink
bool $staticpage_adminlink.page_user
string $staticpage_adminlink.link_edit
string $staticpage_adminlink.link_name
string $staticpage_precontent
string $staticpage_content
array $staticpage_childpages
string $staticpage_childpages[i].permalink
string $staticpage_childpages[i].pagetitle
string $staticpage_categorypage.id
string $staticpage_categorypage.pagetitle
string $staticpage_categorypage.permalink
string $staticpage_categorypage.publishstatus

CSS-Tagy

Backend:
#serendipityStaticpagesNav ul
#serendipityStaticpagesNav ul li
#serendipityStaticpagesNav ul li a
#serendipityStaticpagesNav ul li a#active
Frontend:
.staticpage_navigation_left
.staticpage_navigation_center
.staticpage_navigation_right
#staticpage_childpages
.staticpage_author
.staticpage_metainfo
.staticpage_metainfo_lastchange
.staticpage_metainfo_editlink
#staticpage_related_category_entry_list
#static-entries

TODO (zbývá dodělat)

Historie verzí (ChangeLog)

4.02 Removed some & references, trying to fix issues with more recent PHP versions and core dumps / memory corruption

4.01 PHP 5.4 compat reference fix (~L 1097)

4.00 rewrote document.write replacement (81e9911) to be more html standard conform

3.99  fixed disabling collapsible structure box in case of wysiwyg-editor use 

3.98  Changed custom <title>, meta description, and meta keywords to be regular fields, 
      not custom properties. 

3.97: Changed breadcrumb navigation so it is an independent option.  Templates that use custom
      static page templates (plugin_staticpage.tpl, plugin_staticpage_aboutpage.tpl, 
      plugin_staticpage_related.tpl) must be modified to include the condition
      {if $staticpage_show_breadcrumb}...{/if}.  See included plugin_staticpage.tpl
      for example.

3.96: Added last commits missing code part for the javascript hidden boxes (Timbalu)
      Workaround the use of document.write() for javascript enabled browsers
      Added the need of templates index.tpl change note into forms meta block

3.95: Fixed bad XHTML in <option> tag (Timbalu), 
      added ability to preview staticpages, restrict viewing draft staticpages to logged in authors
      added option to set META input fields, set structure and meta field box to javascript hidden content (Timbalu)

3.94: Add "timestamp" field to list of editable staticpage fields

3.93: Add $serendipity['is_staticpage'] global variable to indicate if staticpage is selected

3.92: extends 1.19: (sidebar) fixed sidebar title

3.91: added dependency nl2br(2.14)::$isobr [NoBR] Buttons
      fixed serendipity_db_query search error output
      set smarty fetch to use nativ API - extends s9y version >= 1.3'

3.90: fixed typo and shrinked last note

3.89: note sidebar plugin availability & update (sidebar 1.18) Fixed smarty load in backend (Timbalu)

3.88: Fixed guestbook link generation for non-rewrites (Timbalu)

1.16: (sidebar) Added smartify option (by Timbalu)

3.87: Add foreach check to prevent error

3.86: Improved 404 page handling (Manko10)

3.84: Added server "Status:" header as well

3.83:
---------------------------

Add missing changes in backend template for selecting a staticpage as 404 error document

3.82:
---------------------------

Add possibility to use a staticpage as 404 error document
by setting the corresponding page property

3.81:
---------------------------

Smarty3 forward compatibility

3.80:
---------------------------

PHP 5.3 compat

3.79:
---------------------------

Beter rename of dirs, by stm9x9
http://board.s9y.org/viewtopic.php?f=3&t=15461

3.78:
---------------------------
Fix properly showing stored custom properties for template when changing a page/template

3.77:
---------------------------

Remember selection of last backend template in a cookie

3.76:
---------------------------

Also allow "_" and "-" in custom backend template names

3.75:
---------------------------

Safety confirmation for deleting staticpages

3.73:
----------------------------
Fix for PHP4 to properly display HTMLArea on default smarty template.


3.72:
-----------------------------
Fix for not being able to edit a staticpage through the frontend's
Edit link


3.70, 3.71:
-----------------------------

Major new functionalities:

    1. Allow to create custom smarty templates used for editing a
       staticpage.
       
       When editing a staticpage in the backend, you now have a dropdown
       where you can choose a template. The default file is placed
       in the plugin's subdirectory "backend_templates". You can
       add files there on your own, which are then shown in the
       dropdown as well.
       
       You can override the content of those files within your
       template directory, by placing a file named exactly the same way,
       in the "backend_templates" sub-directory of your template. 
       Thus, you can put an empty file inside your plugin
       directory to initialize the ability to use a template-preference.
       
       The default template file has several smarty functions to query
       the current value and input fields. You can place all input
       fields the way you like, using Smarty/HTML layouts.
       
       You can also still switch to the "old way" through the dropdown.
       

    2. Introduce "custom properties" for staticpages.
    
        You need to add those custom properties to your custom smarty
        template, by accessing an input field "serendipity[plugin][custom][xxx]".
        The default backend template has a commented section for an
        example on how to use this.
        
        In your final smarty templates (either the staticpage_*.tpl files, or your
        usual smarty template files) you can access those custom properties through
        
        {$staticpage_custom.XXX}
        
        to place them anywhere you want.

To properly see the new layout, you might need to flush your browser's
CSS cache, as changes have been made to the plugin's CSS file.


3.61:
-----------------------------
Speed up call for getting staticpage list and cache it. Otherwise, the
plugin was unusable for thousands of staticpages, because the 
walkrecursive() function is VERY expensive.

3.57:
=============================

Fix smarty function to properly interpret templates passed as argument.

3.53:
==============================
Changes by Stephan Manske:

* new feature: add a related staticpage to a category and the opposite way around


3.32:
==============================
Changes by Falk Döring:

* Update formatting
* Fix pageorder setting

3.30 / 3.31:
==============================
Change by Garvin Hicking:

* Allow to search staticpages via s9y Quicksearch

3.26:
==============================
Change by Garvin Hicking:

* Allow to post/edit staticpages via bookmark URLs / wikilinks plugin

3.24:
==============================
Changes by Falk Döring:

* Change: Pagetype 'Aboutpage' renamed to 'Overview'
* Update: german and english language file
* Update: external plugin menu

3.23:
==============================
* Fix: Filename of CSS backend styles

3.22:
==============================
Changes by Falk Döring:

* Fix: disable templates if a plugin is called

3.21:
==============================
Changes by Falk Döring:

* Fix: FAQ-Event now without mod_rewrite support