GithubHelp home page GithubHelp logo

cmb69 / onepage_xh Goto Github PK

View Code? Open in Web Editor NEW
3.0 5.0 2.0 157 KB

Tools for creating "one pagers" with CMSimple_XH

License: GNU General Public License v3.0

PHP 52.45% CSS 1.86% HTML 45.70%
cmsimple-xh

onepage_xh's Introduction

Onepage_XH

Onepage_XH offers tools to design and administrate so-called "onepage" websites. In the back-end you can administrate the site as usual, but in the front-end a special template is used, which displays all visible pages at once, and the menu links to automatically inserted anchors on the same page.

Requirements

Onepage_XH is a plugin for CMSimple_XH. It requires CMSimple_XH ≥ 1.6.3 and PHP ≥ 5.3.0 with the JSON extension.

Download

The lastest release is available for download on Github.

Installation

The installation is done as with many other CMSimple_XH plugins. See the CMSimple_XH wiki for further details.

  1. Backup the data on your server.
  2. Unzip the distribution on your computer.
  3. Upload the whole directory onepage/ to your server into the CMSimple_XH plugins directory.
  4. Set write permissions for the subdirectories config/, css/ and languages/.

Settings

The plugin's configuration is done as with many other CMSimple_XH plugins in the website's back-end. Select Plugins → Onepage.

You can change the default settings of Onepage_XH under "Config". Hints for the options will be displayed when hovering over the help icons with your mouse.

Localization is done under "Language". You can translate the character strings to your own language (if there is no appropriate language file available), or customize them according to your needs.

The look of Onepage_XH can be changed under "Stylesheet".

Usage

Template

"Onepage" websites require a special template where some of the standard CMSimple_XH template tags are replaced with alternatives provided by Onepage_XH.

onepage_toc()

This is a required replacement for toc(), which displays links to all visible pages.

onepage_content()

This is a required replacement for content(), which shows all visible pages on the start page of the CMSimple_XH installation.

onepage_toplink()

This is an optional replacement for top(), which provides configurable smooth scrolling and is only shown when the user has already scrolled down a bit. Without JavaScript support the link is always shown, and there's no smooth scrolling but rather a jump. The image of the link can be changed by putting an image file named up.png into the images/ folder of the template.

This template tag accepts one optional parameter, the ID of an element. This way you can define the top of the page individually. If you don't pass an argument to the function, the link navigates to the very top of the page.

Unsupported Template Tags

Several template tags are unsupported for "onepage" templates: content(), li(), locator(), mailformlink(), nextpage(), previouspage(), printlink(), searchbox(), sitemaplink(), submenu(), toc().

Page Data Tab

In the tab "Onepage" (above the editor) you can optionally specify an additional CSS class for the respective page. This allows for individual and robust design of the page.

Limitations

Most likely not all plugins will work seemlessly with "onepage" websites. For instance, you can't use page_param's site specific templates and page redirections.

Troubleshooting

Report bugs and ask for support either on Github or in the CMSimple_XH Forum.

License

Onepage_XH is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Onepage_XH is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantibility or fitness for a particular purpose. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Onepage_XH. If not, see http://www.gnu.org/licenses/.

Copyright © Christoph M. Becker

Credits

Onepage_XH was inspired by Ludwig and oldnema.

The plugin logo was designed by Klem. Many thanks for releasing this icon into the public domain.

The "scroll to top" icon is designed by the Oxygen Team. Many thanks for releasing these icons under GPL.

Many thanks to the community at the CMSimple_XH-Forum for tips, suggestions and testing. Especially, I want to thank smaxle and knollsen for early testing and good suggestions. Also special thanks to Holger, lck and frase for long and fruitful discussions with ample suggestions, their testing and code contributions.

Last but not least many thanks to Peter Harteg, the "father" of CMSimple, and all developers of CMSimple_XH, without whom this amazing CMS wouldn't exist.

onepage_xh's People

Contributors

cmb69 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

tn03

onepage_xh's Issues

let template overwrite configuration

That's really important, because certain templates might need special configuration. OTOH, we want still allow template designers and webmasters to use the supposedly simpler way of setting config options via the back-end, at least during the design phase.

See also the related discussion in the forum.

Allow different image formats as TopLink image

The help file writes:

The image of the link can be changed by putting an image file named up.png into the images/ folder of the template.

It would be better to allow any image format as toplink image - not only PNG. Maybe you could search for "toplink-image.*" in the template image folder instead of "up.png". (Make the name more unique and readable).

Link checker: Error with internal links

(XH 1.7.5)

The link checker reports for all internal links:

Error: Broken internal link, anchor does not exist.

This is actually logical for a onepager and probably can't be changed. But I want to mention it here anyway - maybe you'll have an idea about it someday.

After switching to view mode the first page is shown

If I'm editing a page and switch to view mode (via the link in the adminmenu), I always end up at the top of the contents (i.e. the first page). With 1.0beta1 that worked as expected, i.e. the edited page was shown.

This has apparently been caused by commit dfacbfd, effectivly causing fixViewModeLink() to be a no-op.

Use a class for onepage_menu not an id

Problem: Wenn man das OnePage-Menü 2x in der template.htm aufrufen will (1x für ein Desktop-Menü und 1x für ein mobiles Menü), dan ergeben sich doppelte ID's, die laut Spezifikation nur einmal vorkommen sollten. Der W3 Validator beanstandet dies auch als Fehler "Duplicate ID"

return preg_replace('/<ul class/', '<ul id="onepage_menu" class', $html, 1);

menu = document.getElementById("onepage_menu");

Plugin calls changing $hjs only work on start page

If a plugin call that modifies $hjs is placed on any page but the start page, the modification of $hjs will have no effect in visitor mode. The problem is that we're evaluating the scripting in the Onepage_content() call, which happens after $hjs is injected into the <head> of the page.

Scroll with offset value

Onepage pages often have a fixed header. The height of the header should be taken into account as an offset value when scrolling to the IDs.

In my example the header always has exactly a height of 100px.
So I helped myself by entering -100 in this line instead of the value 0.
(I don't know if this is the right place - but in my attempts it didn't work in other places, or there was a "flash".)

Of course, this is only an individual workaround. The value should be configurable.

Unfortunately, there are also one-page templates where the height of the header can change.

Perhaps one should offer:
Either: input of a fixed scroll offset value.
Or: Automatic calculation of the height of the header as scroll offset value.
Of course, it would be ideal to have both options.

link rel="next"

It seems to me that in a onepager, the references in the source code to the next (or even previous) page are not quite in order.

Additional CSS class for individual pages

To be able to style pages individually, there are already IDs (contrived from the page heading, or numerically). For one, this is prone to changes, and for another, this doesn't allow to categorize pages in the template. Therefore it would be nice to be able to set an additional CSS class for each desired page in the page data.

Menu links don't scroll to desired postition

On some browsers (I've noticed that on IE 8, 11 and Edge) the JS scrolling on clicking a menu link doesn't hit the desired position, at least with some templates (I've noticed that with op_ihaveadream). If JS is enabled, scrolling works as expected.

Remove opacity fallback for old IE

The fallback is obviously non-standard, we don't like to deploy nice gimmicks to users of rather old browsers, and most importantly, we don't need the fallback as we've fixed #23.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.