Welcome Guest, Not a member yet? Register   Sign In
PyroCMS v0.9.7.4 - an open-source modular general purpose CMS

[eluser]Phil Sturgeon[/eluser]
Hmm ok, well glad to hear installer is functional now. Getting close to the big 1.0 :-)

[eluser]demogar[/eluser]
is the installtion working properly?

I tried to install it and not all the tables are being created.

Thank you in advance

[eluser]Yorick Peterse[/eluser]
[quote author="Demostenes Garcia" date="1246082369"]is the installtion working properly?

I tried to install it and not all the tables are being created.

Thank you in advance[/quote]

If you have MySQLi installed it should work since all 3 .sql files are included with the installer.

[eluser]Yorick Peterse[/eluser]
It should be working now, there was a syntax error in the tables.sql file.

[eluser]demogar[/eluser]
Thank you very much Smile

And yes, it's working great!

Have a nice day

[eluser]demogar[/eluser]
Hey, I think there's an error with line #48 of application/modules/comments/controllers/admin.php:
Code:
$this->data->modules = $modules + array('module' => 'all');

Must be:
Code:
$this->data->modules = $modules . array('module' => 'all');


I think somebody thought it was js Smile

[eluser]Yorick Peterse[/eluser]
While working on the modules (they need to be cleaned, bigtime) I got more and more annoyed by the amount of modules. In total there are 11 (19 if you include the system modules) modules, which in my opinion is a total overkill. Besides being an overkill it's extremely hard to code a decent template for so many modules, unless they all share the exact same predefined structure. And again that's not something you'd want as it gives the designer less freedom.

I'd say it would be best if PyroCMS will only contain the modules listed below by default. All the others should be available for download.

Modules

- Navigation
- Pages
- Contact
- Galleries
- News

[eluser]demogar[/eluser]
I translated this CMS completely to Spanish, took me a couple of hours btw.

If you would like to have it, tell me and I will send it to you or something.

Cheers!

[eluser]Yorick Peterse[/eluser]
After a bit of thinking about a way to style all modules without having to define any HTML or PHP in the module view itself, I came up with the following idea.

Each module uses the exact same skeleton. This skeleton file can be seen as a template for each module, but without having to make a new template for each module all modules will simply rely upon the same file.

Whenever a certain module is being loaded it will call this skeleton file, which is stored in the user's template, and load it. The skeleton file will define the structure of the content, PyroCMS will only output the raw content. To clarify my idea I created the following skeleton structure :

Code:
<!-- Module title -->
<h3 id="module_title">{MODULE TITLE}</h3>

&lt;!-- Module container --&gt;
<div id="module_container">
    
    &lt;!-- foreach(.....): --&gt;
    
    &lt;!-- Module item --&gt;
    <div class="module_item">
    
    &lt;!-- Item heading --&gt;
    <div class="item_heading">
        <h4>{ITEM TITLE}</h4>
        <p>{ITEM EXTRA}</p>        
    </div>
    
    &lt;!-- Item body --&gt;
    <div class="item_body">
        {ITEM BODY}  
    </div>
    
    &lt;!-- Item bottom --&gt;
    <div class="item_bottom">
        {ITEM BOTTOM}  
    </div>
    
    </div>
    
    &lt;!-- endforeach; --&gt;

</div>

Example

Imagine we have a template called "beer_template", and the skeleton file is called "module.php". Our template's file structure could look like the following :


Code:
themes
|
|
|_beer_template
  |
  |
  |
  |_css
  | |
  | |_reset.css
  | |_style.css
  |
  |
  |_img
  | |
  | |_example.jpg
  |
  |
  |_layout
    |
    |_default.php
    |_default_wide.php
    |_module.php


When PyroCMS loads a certain module it will send the array "$modules" to the module.php, this array will contain the data required for the module. It will also send the variable "$module_name" to the module.php file. In a typical scenario your module.php file will look like the following :


Code:
&lt;!-- Module title --&gt;
<h3 id="module_title">&lt;?php echo $module_name; ?&gt;</h3>

&lt;!-- Module container --&gt;
<div id="module_container module_&lt;?php echo $module_name; ?&gt;">
    
    &lt;?php foreach($modules as $module): ?&gt;
    
    &lt;!-- Module item --&gt;
    <div class="module_item">
    
    &lt;!-- Item heading --&gt;
    <div class="item_heading">
        <h4>&lt;?php echo $module['item_name']; ?&gt;</h4>
        <p>&lt;?php echo $module['some_extra_stuff']; ?&gt;</p>        
    </div>
    
    &lt;!-- Item body --&gt;
    <div class="item_body">
        &lt;?php echo $module['body'];?&gt;
    </div>
    
    &lt;?php if($module['has_bottom'] == true): ?&gt;
    
    &lt;!-- Item bottom --&gt;
    <div class="item_bottom">
        &lt;?php echo $module['bottom']; ?&gt;
    </div>
    
    &lt;?php endif; ?&gt;
    
    </div>
    
    &lt;?php endforeach; ?&gt;

</div>


All the other stuff, such as archives or categories should be placed in the sidebar.

Using this structure will give the user full control over the layout of his template, without having to add a seperate PHP file for every module.

[eluser]Phil Sturgeon[/eluser]
[quote author="Demostenes Garcia" date="1246133976"]Hey, I think there's an error with line #48 of application/modules/comments/controllers/admin.php:
Code:
$this->data->modules = $modules + array('module' => 'all');

Must be:
Code:
$this->data->modules = $modules . array('module' => 'all');


I think somebody thought it was js Smile[/quote]

actually that's perfecty valid php sytax to add an item to an array, like array_merge() :-)

yorick, I'll have a think about that suggestion when I'm not at the pub :-p




Theme © iAndrew 2016 - Forum software by © MyBB