Search

In the same way that Authors and Navigation are available as System data sources, it would be great to have another source available for Sections. This would not be entirely necessary, as I could easily create a section called Sections and store metadata related to each section, such as Section Type. The Publish menu items could then be modified manually, or the menu items could be sorted into separate menus - all without the need for an Extension (although I still really like the idea of a Navigation Editor Extension).

All other admin menus are fixed, so they can be hard-coded. But the Publish menu will change dynamically based on the the Sections created. If I could create a datasource based on Sections, I could dynamically recreate the Symphony admin as a page template with the Publish menu generated dynamically. Then, if I could specify multiple Section types, similar to specifying Page types, I could display section menu items in separate menus according to type.

Then, theoretically, with front-end entries built into pages with a page type of admin, it would be possible to create custom admin pages. I'm assuming that was the intention of the admin page type. See attached for a screenshot of an experiment to add the Developers System Navigation Utility into an admin page layout.

Attachments

By the way, to create the above layout, create a CSS file to import the appropriate styles for the admin page:

@import url("/beta/symphony/assets/tables.css");

I called my file screen.css and stored it in a directory created inside the workspace directory:

/workspace/assets/css/screen.css

I can add my own styles to this file to develop custom page layouts. Then, I can create my admin pages with the following template:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:import href="../utilities/navigation.xsl"/>

<xsl:output method="xml"
  doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
  doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  omit-xml-declaration="yes"
  encoding="UTF-8"
  indent="yes" />

<xsl:variable name="is-logged-in" select="/data/events/login-info/@logged-in"/>
<xsl:variable name="name" select="/data/events/login-info/name"/>
<xsl:variable name="username" select="/data/events/login-info/username"/>
<xsl:variable name="user-type" select="/data/events/login-info/@user-type"/>
<xsl:variable name="user-id" select="/data/events/login-info/@id"/>

<xsl:template match="/">
<html>
  <head>
    <title><xsl:value-of select="$website-name"/></title>
    <link rel="stylesheet" type="text/css" href="{$workspace}/assets/css/screen.css" />
  </head>
  <body>
    <h1><a href="{$root}/"><xsl:value-of select="$website-name"/></a></h1>
    <xsl:apply-templates select="data/navigation"/>
    <xsl:if test="$is-logged-in">
      <xsl:call-template name="user-info"/>
    </xsl:if>
  </body>
</html>
</xsl:template>

</xsl:stylesheet>

The Developers System Navigation Utility was modified slightly to match the Symphony admin HTML structure:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template name="system-navigation">
  <li>Blueprints
    <ul>
      <li><a href="{$root}/symphony/blueprints/pages/">Pages</a></li>
      <li><a href="{$root}/symphony/blueprints/components/">Components</a></li>
      <li><a href="{$root}/symphony/blueprints/sections/">Sections</a></li>
    </ul>
  </li>
  <li>System
    <ul>
      <li><a href="{$root}/symphony/system/authors/">Authors</a></li>
      <li><a href="{$root}/symphony/system/preferences/">Preferences</a></li>
      <li><a href="{$root}/symphony/system/extensions/">Extensions</a></li>
      <li><a href="https://mysql.burnaby.textdrive.com/">Database</a></li>
    </ul>
  </li>
  <li>Debug
    <ul>
      <li><a href="?debug#params">Parameters</a></li>
      <li><a href="?debug#xml">XML</a></li>
      <li><a href="?debug#{concat($current-page,'.xsl')}">XSL</a></li>
      <li><a href="?debug#result">Result</a></li>
    </ul>
  </li>
  <li>Profile
    <ul style="width:15em;">
      <li><a href="?profile#general">General Details</a></li>
      <li><a href="?profile#data-sources">Data Source Execution</a></li>
      <li><a href="?profile#events">Event Execution</a></li>
      <li><a href="?profile#render-statistics">Full Page Render Statistics</a></li>
    </ul>
  </li>
  <li>Community
    <ul style="width:12em;">
      <li><a href="http://www.overture21.com/forum/">Overture Forum</a></li>
      <li><a href="http://beta.overture21.com/forum/">Overture Beta Forum</a></li>
      <li><a href="http://accounts.symphony21.com/">Symphony Accounts</a></li>
      <li><a href="http://bugs.21degrees.com.au/">Beta Bug Tracker</a></li>
      <li><a href="http://sneakpeek.symphony21.com/">Sneak Peak Gallery</a></li>
    </ul>
  </li>
</xsl:template>

<xsl:template name="user-info">
  <ul id="usr">
      <li><a href="{$root}/symphony/system/authors/edit/{$user-id}/" title="Logged in as {$username} ({$user-type})"><xsl:value-of select="$name"/></a></li>
      <li><a href="{$root}/symphony/logout/">Logout</a></li>
  </ul>
</xsl:template>

</xsl:stylesheet>

Oh, I forgot to include the modified navigation utility:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:import href="../utilities/system-navigation.xsl"/>

<xsl:template match="navigation">
  <ul id="nav">
    <li>Pages
      <ul>
        <xsl:apply-templates select="page[not(types/type = 'hidden') and not(types/type = 'admin')]"/>
      </ul>
    </li>

    <xsl:if test="$is-logged-in">
      <xsl:call-template name="system-navigation" />
    </xsl:if>

  </ul>
</xsl:template>

<xsl:template match="page">
  <li>
    <a href="{$root}/{@handle}/">
      <xsl:if test="@handle = $current-page">
        <xsl:attribute name="class">active</xsl:attribute>
      </xsl:if>
      <xsl:value-of select="name"/>
    </a>
  </li>
</xsl:template>

</xsl:stylesheet>

Spiffy!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details