GithubHelp home page GithubHelp logo

octobercms / october Goto Github PK

View Code? Open in Web Editor NEW
11.0K 420.0 2.2K 52.96 MB

Self-hosted CMS platform based on the Laravel PHP Framework.

Home Page: https://octobercms.com/

License: Other

PHP 92.46% JavaScript 1.03% CSS 0.53% HTML 3.70% Less 2.20% Hack 0.08%
cms framework cmf laravel php platform octobercms backend cms-platform

october's People

Contributors

adrenth avatar alekseybobkov avatar alvaro-canepa avatar alxy avatar bennothommo avatar daftspunk avatar danharrin avatar dshoreman avatar fansaien avatar flynsarmy avatar gabsource avatar gergo85 avatar gpasztor87 avatar jimcottrell avatar joelesvensson avatar klaasie avatar luketowers avatar marininicola avatar mjauvin avatar mplodowski avatar nathan-van-der-werf avatar octoberapp avatar paulwilde avatar samgeorges avatar samuell1 avatar scottbedard avatar stefantalen avatar tobias-kuendig avatar vojtasvoboda avatar w20k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

october's Issues

Default Plugins url errors

If I go to /plugins I get the following error:

An exception has been thrown during the rendering of a template ("The component 'demoTodo' is not found.").
C:\xampPHP54\htdocs\octobercms/themes/demo/pages/plugins.htm line 12

Latest update as of today (I think it was 11). Using windows 7 xampp 1.8.2

Improve paginate() method

It is unnatural to set the current pagination page by using:

App::make('paginator')->setCurrentPage(2);

We should include this as part of the ->paginate() method in the Model. Eg:

$model->paginate(<records per page>, <current page>, [...]);

Unable to rename CMS assets

When trying to rename an asset in the CMS module, the following message is displayed:
Path can contain only digits, Latin letters, spaces and the following symbols: ._-/

This issue is probably caused by a merge of different JavaScript objects using jQuery's $.extend() function. When comparing the objects before and after merging, it seems that data.renamePath disappeared after the merge, which is the value used by the onLoadRenamePopup() to determine the current path.

Possible Solution
To fix this issue, change /modules/system/assets/js/framework.js (line 259) to:

var options = $.extend(true, {}, Request.DEFAULTS, data, typeof option == 'object' && option)

jQuery's $.extend() only merges at the top level, discarding values as soon as another object contains the same top level object. Enable merging at the second level by passing true as first argument to $.extend().

"Internal Server Error" after image upload

When uploading an avatar on the administrators settings page, and the GD library extension is not loaded, the (cryptical) message Error uploading file: Internal Server Error is shown. When saving the settings, it won't be possible to access the settings page again (see screenshot), until the file is removed from the system_files database table. (This issue will also affect other modules that allow image uploading, like Rainlab.Blog)

october_avatar

Possible solutions

  1. Throw an exception when trying to upload an image file without GD enabled, by modifying checkUploadPostback() (modules/backend/formwidgets/FileUpload.php):

    if ($isImage)
    {
        $validationRules[] = 'mimes:jpg,jpeg,bmp,png';
    
        if (!function_exists('gd_info'))
            throw new SystemException('Uploading images is only possible with the GD library installed');
    }
  2. Add the GD library to the system requirements check during install
    (function_exists('gd_info') or extension_loaded('gd'))

Order exact match search query first

When I type / into the search query in the pages list, I'm more often than not looking for the index page. I'd like exact match query results to appear before other results when searching.

I sometimes don't know what the index page's title is, so using the slug is the best option.

Twig Placeholder {% put %} must come first

For some reason the page appears blank if the {% put %} tag appears below the page content.

<h1>I am content!</h1>

{% put scripts %}
<script>
...
</script>
{% endput %}

The H1 tag never appears on the page.

Create front end AJAX loader

Front-end AJAX requests by default do not display any sort of load indicator. Since there is no easy way to emulate the browsers loading behavior, there should be a generic AJAX loader available to the front-end.

This should be bundled with the framework using an additional token value:

{% framework extras %}

The additional extras part will include some desirable extras a developer may want, but not need in all cases. The AJAX loader is the only extra that qualifies for this currently.

Once included, all AJAX requests will display a loading indicator similar to the back-end stripe loader.

"Error saving file" when creating empty asset or content block

When creating a new empty content block or asset via the CMS module, the message Error saving file "test-content.htm" is being displayed. However, the file is still being created.

This is possibly being caused by the save() function in /modules/cms/classes/CmsObject.php (line 335), which will only check the value and not the variable type:

if (@file_put_contents($fullPath, $this->content) == false)

file_put_contents() returns a false or the file size, so a return value of 0 as well as false will match.

Possible solutions

  1. Check not only value, but also the type: if (@file_put_contents($fullPath, $this->content) === false)
  2. Validate the content input and do not allow an empty content.

Is alpha only accepts root user for SQL?

Is alpha only accepts root user for SQL? I've installed it on my cPanel, entered all details, installation done. But when I log in to backend it says SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) and SQL structure is empty.

Create a pipe for front-end assets

Components and plugins may wish to provide front-end assets (JavaScript, StyleSheet files). There should be a standard method to inject these in to front-end pages.

This can be achieved with an optional placeholder tag for each:

<head>
  {% styles %}
</head>
<body>
  <!-- Content -->
  {% scripts %}
</body>

Create the token parsers for each, along with an approach to extend the Cms Controller class.

Prototype code:

Cms\Classes\Controller::extend(function($controller) {
  $controller->addJs('/path/to/script.js');
  $controller->addCss('/path/to/style.css');
});

The Backend Controller currently uses an AssetMaker trait which may be a candidate for this. If so it should be moved to the System module.

Add support for 'condition' default relation filter

As per docs:

Default relationship filters can be used on all relations:

  • order - sorting order for multiple records.
  • conditions - applies a where statement. (TODO)
  public $belongsToMany = [
    'categories' => ['Category', 'order' => 'name desc', 'conditions' => 'active = 1']
  ];

Layout changes are only shown after cleared cache

When modifying a layout via the CMS module, changes are only displayed after the cache is cleared (or cache expires). Issue verified with file and memcached driver.

Possible solution
Clear cache after a layout modification: Cache::flush()

Add support for hasManyThrough

With the introduction of Laravel 4.1 there is a new hasManyThrough relationship definition. This should be ported to October's ActiveRecord model.

Prototype code:

// Country
protected $hasManyThrough = [
    'posts' => ['Post', 'through'=> 'User', 'foriegnKey' => 'country_id', 'throughKey' => 'user_id']
];

Whilst there, during the upgrade there were some additional parameters made available (localKey) that should also be added to the exisiting relationship accepted parameters.

Page title doesn't change when changing CMS tab

Using the CMS module, the page title (<title>bla</title>) only changes when loading a fresh page/partial/layout/etc. When clicking one of the already opened tabs in the CMS navigation, the page title doesn't change.

It looks like the page title is only set when loading AJAX content (via handleUpdateResponse() in modules/system/assets/js/framework.js).

Possible solution
Change the page title when a tab is shown, by adding something like $('title').html($(event.target).attr('title')); to the modules/cms/assets/js/october.cmspage.js file (inside the shown.bs.tab trigger). Undo the changing combined with the AJAX call.

Implement the Filter Widget

A Filter behavior will modify the controller to allow a dataset to be filtered, for example, the dataset used by a List behavior. If the list records were blog posts:

  • Filter by Post Category
  • Filter by Post Status

These filters can be registered as classes which contain the filtering logic against the model query object.

Filter scenarios:

  • Filter by relation / join, Eg: status or category (as above).
  • Allow empty exclusions. Eg: if every foreign record is selected, exclude the primary records without a set relation.
  • Filter by a simple array. Eg: Where column value is in [active, draft, hidden].
  • Filter by boolean. Eg: Show deleted / Hide deleted.

Property or Parameter helper

Proposal for a helper function in components called propertyOrParam() which returns the property value or the router parameter if the first argument starts with a colon (:)

$this->property('id') + $this->param('id') = $this->propertyOrParam('id')

Hard coded (property value) example:

title = "Hard coded to display Blog Post with ID of 2"
url = "/a-hard-coded-page"

[blogPost]
id = "2"
==

{% component 'blogPost' %}

Dynamic (routing parameter value) example:

title = "Display Blog Post with ID set in my_custom_parameter"
url = "/a-dynamic-page/:my_custom_parameter"

[blogPost]
id = ":my_custom_parameter"
==

{% component 'blogPost' %}

In both examples, the value can be accessed in the component via

$this->propertyOrParam('id')

Refresh CMS template from file system

When working in the file system and the October GUI simultaneously, the GUI will lose sync with the file system. The current solution is to refresh the CMS page and the changes will be picked up.

Perhaps if we implement a Cmd/Ctrl+click event. Example:

  • Ctrl+click Partials side nav will refresh the partials list
  • Ctrl+click CMS template will refresh the template (if it is open)

Pages need a hidden flag

Pages are published by default, meaning anyone can access them.

I propose a hidden flag to allow developers to make unfinished pages unavailable.

Prototype code:

title = "Forum"
url = "/forum"
layout = "default"
hidden = true
==

<h1>Forum</h1>
...

This would also include the addition of a checkbox in the back-end.

  • Hide page: When this is checked, the page is not accessible on the front-end.

Ability to override Component partials (Cherry pick method II)

The current solution (#41) is a bit flakey. After some careful consideration, the following approach should be used instead.


Components referencing partials

Components can reference their partials in two ways. First is an explicit method:

{% partial __SELF__ ~ "::title" %}

The second is a relaxed method:

{% partial "@title" %}

The relaxed method is contextual:

  1. If called inside a component partial, it will directly refer to itself.
  2. If called inside a theme partial, it will scan all components used on the page/layout for a matching partial name and use that. Then will continue as per 1. for nested partials.

Overriding component partials

All component partials can be overridden using the theme partials. Following from the previous example, if our component called channel uses the title.htm partial.

url = "mypage"

[channel]
==
{% component "channel" %}

We can override the partial by creating a file in our theme called partials/channel/title.htm.

The file path is broken down like this:

  • partials - the theme partials directory
  • channel - the component alias (a partial subdirectory)
  • title.htm - the component partial to override

We can choose our own name for the partial subdirectory by giving the component a different alias. For example:

[channel foobar]
==
{% component "foobar" %}

Now we can override the partial by creating a file in our theme called partials/foobar/title.htm.

Support for long Asset file names

When folder/file names are too long, they show underneath the checkbox in the file list pane.

qDLBlmh.png

Suggested solutions:

  • They should show โ€ฆ and their hover tooltip should be their full name.
  • They should force wrap.

Google Chrome touch functionality

As @daftspunk found out today, there are some issues with the UI when those (new) touch events in Chrome are enabled. That means, that I am not able to see any of the "popups" on tab "CMS".

However, I found a way to disable the touch events:
1.) Open "chrome://flags/" in browser
2.) Search for "touch events" (or similar, I use a german language pack)
3.) Disbable the found option (default is auto)

Improvements to SEO tab

Some changes to the SEO tab of a page are needed.

  • Remove keywords (these are reduntant)
  • Add a title field
  • Character limit fields

Title - 60 characters
Description - 160 characters

As per specs:

Meta Description: Meta descriptions can be any length, but search engines generally truncate snippets longer than 160 characters. It is best to keep meta descriptions between 150 and 160 characters.

source: http://moz.com/learn/seo/meta-description

Title Tag: Search engines will truncate titles in search results that exceed a certain length. For Google, this length is usually between 50-60 characters, or 512 pixels wide

source: http://moz.com/learn/seo/title-tag

Existing components are missing their icons

How to replicate:

  1. Open any layout/page that uses a component in the CMS
  2. Notice it is missing the icon
  3. Add a new component to the layout/page
  4. You should see the icon appears only for new components, not for existing ones

Checkbox preview should be disabled

When on a preview form, the checkbox field retains its click functionality.

The functionality should be disabled as it is a preview only.

Backend sign in forms require styling

The entrance backend forms require a style update to match the remaining application. Forms:

  • Backend sign in
  • Backend restore password request
  • Backend reset password form

Plugin required dependencies

A core function of October, interconnected plugins should define their relationships to each other called "required dependencies".

The dependant plugin will require its dependency or dependencies (required plugins). This definition will produce some outcomes:

Active ideas

  • The package server should mimic composer where possible. If a requirement is not found in the system, it will be automatically installed (FREE only).
  • Paid plugins cannot be installed automatically, a warning must be displayed to notify the user that this plugin is disabled because it requires a paid plugin and project usage.
  • The client needs to tell the server what version it needs. See #785 "locked snapshot".
  • The server needs to analyse plugin definitions and save the requirements, for display on the UI and for automatic delivery.
  • The $require property values should support @1.0.1 suffix to indicate the minimum version required.
  • A special code Core is needed to signify a minimum core build. eg: Core@154 requires core build 154 or later.

Implemented ideas

  • If a dependant plugin is present in the file system but its required plugins are not, the dependant plugin will not be loaded to prevent system errors.
  • During database migration, required plugins should have their version history built before dependant plugins.
  • In honour of the $implement definition for behavior usage, the definition can be stored in the $require property, found in the Plugin registration file. The prototype code can look like this:
public $require = [
    'October.Blog',
    '[email protected]'
];

Old ideas (won't implement):

  • If a dependant plugin is installed or added to a project for the first time, the UI will prompt the user to include the required plugins as well.
  • As above, if a required plugin has an associated cost, the dependant plugin will be installed in an incomplete state, not loaded to prevent system errors and the UI will alert the user to consider purchasing it.

Prompt messages:

October.Blog requires October.Demo to be installed, click OK to install it.

                              [ Ok | Cancel ]
October.Blog requires some other plugins to operate:

* Acme.XXX ($9.99)
* Acme.YYY ($4.99)

Consider purchasing the required plugins before using this plugin.

                              [ Ok ]

Add tooltip to unsaved CMS templates

When there is a number 1 in a red box next to the Pages entry. It may confusing what it does or how to remove it. It has no tooltip or way of dismissing.

There should be a tool tip to indicate this is # of unsaved items.

Need a way to predefine component routes

Some components will likely always need a rout.

We need a way to automate the appended :paramId

For flexibility, it may be preferable to only append the param on initial addition of the component so that page routs can still be modified and/or added to.

But it's also likely a way should be defined to allow a permanent requirement.

But it is rocket science

Seriously.

  • MVC
  • back-end Package management
  • front-end Package management
  • Source control (git)
  • CSS pre-processors (LESS, SASS)
  • Responsive frameworks (bootstrap)
  • HTML5 / CSS3
  • Browser compatibility...
  • Information Architecture
  • Content strategies
  • Hosting environments
  • Linux Server administration
  • Deployment packages
  • Task runners (Grunt.js, Gulp.js)

on and on and on....

Ability to override Component partials (Cherry pick method)

Some Plugins can have many interconnecting partial references. This can become an issue when a theme wants to change a single partial in a component. At the moment the plugin's entire partial structure must be rebuilt in the theme up until the point the partial is used.

Concept one

Let's take the Plugin called Forum for example, with a component named Channel, it has these partials:

default.htm
pagination.htm
topics.htm
title.htm

And look at the code inside default.htm:

<div class="rainlab-forum">
    {% partial __SELF__ ~ "::title" %}

    {% partial __SELF__ ~ "::topics" %}

    {% partial __SELF__ ~ "::pagination" %}
</div>

Let's say a user wants to override the title partial only. As a component developer, I can predict this and make room for it. If I change the partial code to this:

{% partial "title" %}

By using this code instead, we will say:

  1. Look at the Theme for partials/title.htm
  2. If nothing found, look at each component used, find the one with partials/title.htm
  3. Render the result, or produce an error (Partial not found)

There is one problem with this scenario, the name "title" is too generic. It should be called "forum_channel_title" instead, but let's ignore that and keep it simple for now.

Concept two

But what if we don't want the partial to overriden by the theme, I like the idea of using short partial names. This can be possible by forcing the CMS to look at Components first, not the Theme.

{% partial @"pagination" %}

The @ symbol is responsible for this here. It will translate to ::pagination, when the component name is missing like this, all available components will be scanned. This is a "relaxed" approach.

However, to avoid conflicts with other components, a strict approach can be used, like so:

{% partial __SELF__ ~ "::pagination" %}

This is not as pretty, but it explicitly defines the component alias and will eliminate the possibility of another component used on a page or layout that also has a partial called pagination.

Concept three

Extending concept one, it can still be possible to override a component on the basis of it's alias.

Take this page code for example, the same component is used twice, with a separate alias, and separate config.

[channel myChannel1]
...
[channel myChannel2]
...
==
{% component 'myChannel1' %}
{% component 'myChannel2' %}

This is how we can override title.htm in this scenario, inside the theme /partials folder:

  • mychannel1\title.htm <== Custom partial for myChannel1 (Priorty 1)
  • mychannel2\title.htm <== Custom partial for myChannel2 (Priorty 1)
  • title.htm <== Custom partial for both (Priorty 2)

We can cherry pick the partial, based on the alias given to the component.

"Forbidden" after changing admin details

If you change the admin password and hit save, it looks like you can still use the page, so try changing the avatar and you get javascript "forbidden" message.
Changing admin details should log you out and redirect to login page, or auto log you in with new details

Add encrypted attribute modifier

Related issue:
rainlab/mailchimp-plugin#1

In the same family as hashable, purgeable and jsonable; another type is needed for storing sensitive data in the database encrypted.

This should be added to October's ActiveRecord model.

class User extends \October\Rain\Database\Model
{
    protected $hashable = ['password'];

    protected $purgeable = ['password_confirmation'];

    protected $jsonable = ['permissions'];

    protected $encrypted = ['api_key']; // <== New
}
  • $encrypted - values are encrypted and decrypted for storing sensitive data.

CMS Template unload prompt appears twice

When clicking the close link on an edited Layout tab, a popup asking to discard changes appears twice.

How to replicate:

  1. Open any CMS Template
  2. Make changes
  3. Close the template without saving
  4. When prompted "Are you sure?", click Cancel
  5. Notice the prompt appears a 2nd time

Subdirectory URL without trailing slash causes 403 error

When putting October into a subdirectory, it only works when adding the trailing slash to the URL (http://localhost/october/). The URL without trailing slash (http://localhost/october) will display a 403 error or the directory listing.

To fix this issue, add the following to the .htaccess file:

RewriteOptions AllowNoSlash

Info: https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriteoptions

When installing to a subdirectory, a RewriteBase should also be set in the .htaccess. It would be great if this could be automated during the install (since it's one of my most heard questions when installing a CMS), but this might as well be just a little note in the installation doc.

The ability to reuse a component and it's settings

Problem: There's not currently a way to "dupe" a component or it's settings. There will most definitely be a need for this.

Users will want a way to reuse a component with all of the exact same settings.

Example:

  • working on a new "get directions" map that has several view types such as a sidebar view, footer view, simple link view, small map view, large map view....ect
  • the component collects full address, location title, view type, and base hue. (so not exactly quick to fill out.)
  • users will likely have a need to add a sidebar map component. But may not want that component positioned the same from page to page. for example, the 'contact' us page may want that sidebar component further up.
  • In this regard, since components can only be added to pages and layouts currently, this is a bit cumbersome to achieve and would require filling out the component with the exact same information more than once and/or have multiple layouts. All so you can have varying map information positioned in various ways.. Sigh.....this feels very inelegant and overly cumbersome.

Possible Solutions:

  • allow components to be added to partials. (what I think is the most flexible solution)
  • add a pulldown in the component block when added to a page that includes all previous aliases used whereas all settings from that alias are pulled in instantly. (meh..)
  • no pulldown, but typing in an already used alias automatically pulls in component settings of the same alias name and component type, but can still be changed. (this could be the most elegant solution and would place no load on rendering)

Force Update should work

At the moment when there are no new updates, the Force Update button does not work as expected.

  1. Navigate to System > Updates
  2. Click Check for updates
  3. When "No new updates were found." is displayed, click Force update
  4. The window simply closes.

Clicking Force update should trigger a complete update of the system and the plugins currently installed.

Create page picker Inspector field type

Implement a field type called page in the Inspector editor.

Currently required for many components that define redirection pages and for creating relationships between components.

Simply the page picker will allow the selection of a page in the current theme, the returning result will be the page file name (without extension) as used in the page filter.

{{ 'folder/filename'|page }}

Maintenance mode for front-end

There should be an interface for placing the website in Maintenance mode. The UI should specify a page name, this page will be shown to the front-end user when the site is in Maintenance mode.

If the user is currently logged in to the back-end as an Administrator, the Maintenance mode flag will not affect them. They should still be able to freely navigate the website.

Extend clear cache CLI function

Extend the cache:clear artisan command to also cleanDirectory() the introduced storage folders.

php artisan cache:clear

Should also clear these introduced storage folders:

  • app/storage/twig
  • app/storage/combiner

Popup error on CMS assets

If I go to CMS, assets, and click on any of the items in the list. I get the following error:

"Path can contain only digits, Latin letters, spaces and the followign symboles: ._-/"

It pops up as a browser alert (little popup window that doen't let you do anything in the browser till you hit "ok"

Latest update as of today (I think it was 11). Using windows 7 xampp 1.8.2

Build the Context Help System

Refer to the question mark (?) located in the top right of the backend interface.

  • When the question mark is clicked, all elements on the page that have a help context string specified should be highlighted.
  • The help document should be displayed in a popup window.

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.