Page Template sample which just redirect to the page (5.7.x)

This is a community-contributed tutorial. This tutorial is over a year old and may not apply to your version of Concrete CMS.
Dec 29, 2015

Sometime, "external link" doesn't fulfill your requirement for the page. You may want to display thumbnail image, additional page attribute such as topic and selector attributes to display the categories of the page.

This tutorial explains how to set-up redirect-only page with more page attributes option by creating redirect-only page template and page type in your theme.

(You may also want to customize your Page List and/or Autonav Blocks if you want to avoid additional redirect requests)

Disclaimer

I hold no responsibility over any damages caused by using this script.

Requirement

This uses Page Selector Attribute

https://marketplace.concretecms.com/marketplace/addons/page-selector-attribute1/

How to set-it up

Currently, if you are the site editor who can see the Concrete CMS toolbar on top, you won't get redirected but stayed on the page so that you'll be able to edit.

Basic Set-ups

  • Copy and paste redirect.php below and create a page template under your theme.
  • Create a page type. Add composer elements to enter page name, url and the following page attributes.

external_page Page Selector Attribute

Create a page selector attribute called "external_page"

Or comment out or delete from line 6-10.

external_link Text Attribute

Create a text page attribute called external_link, which you enter URL.

If both externap_page and external_link was entered, externap_page will be used.

Hint: You could add File Attributes

You could add File Attribute to have them download the file.

Code Sample

Code is available on the gist

https://gist.github.com/katzueno/146261d07111ad23fe44

Recent Tutorials
Customize locale icons
Oct 29, 2024
By myq.

How to customize locale (language region) flags

Concrete CMS Caching Guide
Oct 16, 2024

An overview of types of caching in Concrete and considerations when using them.

Redirect all requests to HTTPS
Oct 9, 2024
By myq.

How to follow best practices for a secure web

Upgrade Concrete versions 9.3.1 and 9.3.2
Sep 10, 2024
By myq.

How to get past a bug in versions 9.3.1 and 9.3.2 that prevents upgrading the Concrete core through the Dashboard

How to use Composer with Marketplace extensions
Aug 22, 2024

Composer can be used to manage third-party extensions from the marketplace

Controlling Google Tag Manager Tags Based on Concrete CMS Edit Toolbar Visibility
Aug 13, 2024

This document provides a step-by-step guide on how to control the firing of Google Tag Manager (GTM) tags based on the visibility of the Concrete CMS edit toolbar. It explains how to create a custom JavaScript variable in GTM to detect whether the edit toolbar is present on a page and how to set up a trigger that ensures GTM tags only fire when the toolbar is not visible. This setup is particularly useful for developers and marketers who want to ensure that tracking and analytics tags are not activated during content editing sessions, thereby preserving the accuracy of data collected.

Improvements?

Let us know by posting here.