howto: 404 page not found
  • Vote Up0Vote Down Micz FlorMicz Flor
    Posts: 184Administrator
    hi daniel, here is an important feature where i don't know if it is in the manual:

    Quote:
    you can do the same on campsite. Just make a template and define it as 404 handler in the publication settings. This option was introduced in 3.4 version. You should follow press releases Wink

    Andrey.

    On Tue, Dec 7, 2010 at 2:10 PM, Micz Flor wrote:
    hi,

    quick question: there is a potential issue with wrong URLs in campsite.
    when you type the wrong URL, the system goes a bit crazy (see example
    below). the adequate way to deal with this would be: page not found.
  • 1 Comment sorted by
  • There's a new option in the publication configuration page: invalid URL
    template (see attached screenshot).

    The URL template object has a new attribute: is_valid. See the template code
    below, taken from the default demo package in Campsite:

    {{ if !$campsite->url->is_valid }}
    <h3>{{ if $campsite->language->name == "English" }}The requested page was
    not found.{{ else }}La página solicitada no fue encontrada.{{ /if }}</h3>
    {{ set_language
    name=`$campsite->publication->default_language->english_name` }}
    {{ set_current_issue }}
    {{ else }}
    {{ ** display content **}}
    {{ /if }}

    Also, Campsite returns the proper headers (404 not found) for an invalid
    URL.

    Mugur Rus
    Senior Software Developer, Sourcefabric
    mugur.rus@sourcefabric.org

    Cluj-Napoca, Romania
    +40 (0)720 528408
    Skype: mugur_rus

    Subscribe to our Newsletter:
    www.sourcefabric.org/newsletter/

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric



    On Tue, Dec 7, 2010 at 2:25 PM, Micz Flor <
    campsite-doc@lists.sourcefabric.org> wrote:

    > hi daniel, here is an important feature where i don't know if it is in
    > the manual:
    >
    > Quote:
    >
    > you can do the same on campsite. Just make a template and define it as 404
    > handler in the publication settings. This option was introduced in 3.4
    > version. You should follow press releases [image: Wink]
    >
    > Andrey.
    >
    > On Tue, Dec 7, 2010 at 2:10 PM, Micz Flor wrote:
    > hi,
    >
    > quick question: there is a potential issue with wrong URLs in campsite.
    > when you type the wrong URL, the system goes a bit crazy (see example
    > below). the adequate way to deal with this would be: page not found.
    >
    >
    >