ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

PyroCMS v0.9.9

December 21, 2009 12:55pm

Subscribe [27]
  • #151 / Apr 20, 2010 1:03pm

    Phil Sturgeon

    2889 posts

    Nah he is right. In the world of Git we have the awesome staging area so we can chose what to commit in one go. You can even commit certain lins out of a file, which means the old SVN change-commit is redundant.

    It’s not massively important but I have to manually review each. As long as commits are logically groups (only relevant stuff in each commit) then the fewer the better.

    I’ll have a look at this later today, thanks Isern.

  • #152 / Apr 21, 2010 11:32am

    Is there any nice solution for navigation module? I need submenu. Waiting for reply.

  • #153 / Apr 21, 2010 11:45am

    Phil Sturgeon

    2889 posts

    You don’t need to add “Waiting for reply.” to each message. I will reply when I can (which is usually pretty quick anyway). 😛

    There is no sub-menu feature available just yet, there will be in v0.9.8.1.

    If you need it sooner, feel free to develop a solution yourself and submit as a fork to GitHub.

  • #154 / Apr 22, 2010 6:34am

    Thanks, I’ll try to develop for myself.

    foreach(navigation('sidebar') as $nav_link): 
        if ($nav_link->parent == 0)  {
            $parent_menu[$nav_link->id]['label'] = $nav_link->title;
            $parent_menu[$nav_link->id]['link'] = $nav_link->url;
        } else {
            $sub_menu[$nav_link->id]['parent'] = $nav_link->parent;
            $sub_menu[$nav_link->id]['label'] = $nav_link->title;
            $sub_menu[$nav_link->id]['link'] = $nav_link->url;
            $parent_menu[$nav_link->parent]['count']++;
        }
        endforeach;

    When I use this code, I’m getting this error

    A PHP Error was encountered
    
    Severity: Notice
    
    Message: Undefined index: count

    So what is the problem inside this code?

  • #155 / Apr 22, 2010 7:38am

    Phil Sturgeon

    2889 posts

    The problem is that $parent_menu[$nav_link->parent][‘count’] has not been defined before you are trying to increment the value. If you are new to CodeIgniter then you may not be used to having error reporting turned up so high.

    This is normally the sort of thing that PHP will let you get away with, but not here sonny-jim! :lol:

    foreach(navigation('sidebar') as $nav_link):
        if ($nav_link->parent == 0)  {
            $parent_menu[$nav_link->id]['label'] = $nav_link->title;
            $parent_menu[$nav_link->id]['link'] = $nav_link->url;
        } else {
            $sub_menu[$nav_link->id]['parent'] = $nav_link->parent;
            $sub_menu[$nav_link->id]['label'] = $nav_link->title;
            $sub_menu[$nav_link->id]['link'] = $nav_link->url;
            $sub_menu[$nav_link->id]['count'] = 0;
            $parent_menu[$nav_link->parent]['count']++;
        }
        endforeach;
  • #156 / Apr 22, 2010 10:53am

    no, the problem is before that code. I mean

    $sub_menu[$nav_link->id]['count'] = 0;

    gives an error.

    but the code below is working fine, because it was specified.

    $parent_menu[$nav_link->parent]['count']++;
  • #157 / Apr 22, 2010 11:55am

    Phil Sturgeon

    2889 posts

    Good luck working it out. Really mate, I can’t help with every step. This is a basic PHP coding question.

  • #158 / Apr 22, 2010 12:42pm

    For those who really needs submenu solution for their PyroCMS project.

    1. add parent_id column to your navigation_links column
    2. add parent_id rules to your admin controller inside navigation module

    $rules['parent_id'] = 'trim|numeric';

    3. Admin_Controller add this code under _construct function

    if($parentss = $this->navigation_m->get_parents())
            {
                foreach($parentss AS $parents)
                {
                    $this->data->parentss[$parents->id] = $parents->title;
                }
            }

    4. Add this code to navigation_m model

    function get_parents()
        {
            $this->db->select('navigation_links.*');
            $this->db->where('parent_id',0);
            return $this->db->get('navigation_links')->result();
        }

    5. Add this code to form.php at navigation module

    <li class="even">
                        <label for="target"><?php echo lang('nav_parent_label'); ?></label>
                        <?php echo form_dropdown('parent_id', array(lang('nav_link_parent_select_default'))+$parentss, $navigation_link->parent_id) ?>
                    </li>

    6. Add this function to navigation_helper

    function generateMenu($array, $parent = 0, $level = 0)
    {
    
      //
      // Reset the flag each time the function is called
      //
      $has_children = false;
    
      //
      // Loop through each item of the list array
      //
      foreach($array as $key => $value)
      {
        if ($value['parent_id'] == $parent) 
        {                   
    
          //
          // Only print the wrapper ('<ul>') if this is the first child (otherwise just print the item)      
          // Will be false each time the function is called again
          //
          if ($has_children === false)
          {
            //
            // Switch the flag, start the list wrapper, increase the level count
            //
            $has_children = true;  
    
            echo '<ul class="level-' . $level . '">';
    
            $level++;
          }
    
          //
          // Print the list item
          //
          echo '<li><a href="http://?id="> . '"]' . $value['title'] . '</a>';
    
          //
          // Repeat function, using the current item's key (id) as the parent_id argument
          // Gives us a nested list of subcategories
          //
          generateMenu($array, $key, $level); 
    
          //
          // Close the item
          //
          echo '</li>';
    
    
        }
    
      }
    
      //
      // If we opened the wrapper above, close it.
      //
      if ($has_children === true) echo '</ul>';
    
    
    }

    7. Call this menu inside leftnav.php “theme view folder”

    foreach(navigation('sidebar') as $nav_link): 
            $menus[$nav_link->id] = array(
                'id' => $nav_link->id, 
                'title' => $nav_link->title, 
                'parent_id' => $nav_link->parent_id
              );
    
        endforeach;
        
        echo generateMenu($menus);

    8. Voila! main menu and sub menu solution is ready, but I hope in the next version it will be more easily done.

  • #159 / Apr 30, 2010 7:04pm

    ayukawaa

    17 posts

    Hello,

    I have read in another post that if I want another ‘default’ page I have to hard coded it (application/modules/core/pages/controllers/pages.php => private $default_segment = ‘home’;)

    That is nonsense.

    I just re-install the cms and after inserting my pages, I delete by error the example ‘Home’ page which is the ‘default’ page and then the default page change to “Page missing”.

    That is right (after all I delete it) but is there an option elsewhere IN THE ADMINISTRATION to select which is the default page?

    What if I don’t have easy access to the MySQL/code in the server?

    If the default page CAN NOT BE CHANGED FROM THE ADMIN AREA, then I SHOULD NOT BE ALLOWED TO DELETE IT.

    Or, if the system detects the default page no longer exists, then give a chance to select another one.

    Thanks and good job.

    I would love to see an 1.0.0 version soon ^_^

    ———-

    Edit:

    Ooopps, another one:

    In the Photos module, I don’t have access to modify the text of a photo after inserted.

    I can only delete and upload it again to have access to change the text.

    Could it be added to each photo a small html textarea?

    I’m thinking about an explanation of the picture (like a catalog of products with description, sell price, etc)

    And what about selecting in the administration if comments ARE allowed (where posible, not moderated) like in photo galleries.

    And… OMG! I have just realized that it doesn’t have a SEARCH BUTTON!!!

    *_*

  • #160 / May 02, 2010 9:23am

    Phil Sturgeon

    2889 posts

    WOW OMG EVERYTHING IS RIDICULOUS!

    I’m always happy to have feedback but please make it constructive and leave out the “nonsense” comments. Myself (and recently several others) work our balls off on PyroCMS for little-to-no credit and barely any money. Feel free to post some “Feature Requests” on our forums so they can be discussed and planned.

  • #161 / May 03, 2010 5:19am

    ayukawaa

    17 posts

    Sooooorrry!

    Perhaps I do not give the words the same meaning you give it! I’m sorry if you think it that way.

    I AM a PHP programmer and knows very well what it is when people thinks low of my work.

    Sorry again, I must have been sleepless and did not think when translating into english.

    I can only add that if I write here it’s because I like it. I prefer to keep quiet rather than make stupid comments

    *_*

  • #162 / May 04, 2010 6:35pm

    Michel-Ange

    79 posts

    Hi Phil !

    I just read on this thread about multi-lingual content :

    As I see it there are several types of multi-lingual requirements that don’t always contrast.

    1.) The site is available in one language only, all content is entered in this language (Currently supported).

    2.) All content has fields for each any every language, meaning that to add an article it should be added in all languages.

    3.) The site should be totally different for each language (might as well be a multi-site manager).

    I really f**king hate the idea of 2 which also happens to be the way Ionize works.

    I’m sorry but I have to correct what you are saying so politely (also on your forum) about Ionize and languages content.

    Ionize gives you the ability to translate - or not - any content (pages, articles) but it is not mandatory to translate everything. You can play with filters in your views and just display an article if the title exists (for example).

    That means if your article isn’t translated in english because your translator is on vacation and / or you don’t want to translate it, the english version of your article will not be displayed in the article list.

    Don’t hesitate to have a look at the demo at http://demo.ionizecms.com to see in live this possibility.

    I wish you the best with PyroCMS, and I will not say anything about it because I don’t know it enough.
    I will just say that PyroCMS is a great project and that I’m happy that finally some serious CMS using CodeIgniter came out.

  • #163 / May 05, 2010 3:05am

    Phil Sturgeon

    2889 posts

    Hey Michel-Ange,

    I am perfectly familiar with IonizeCMS and the approach for it’s multi-lingual content and even recommended it to a user on the #pyrocms IRC requesting your specific featureset.

    While creating multiple content boxes for each language available is going to be the easiest method, there are several other issues with it.

    1.) Should the content default to English or show as missing? Some people have asked for both, but could probably just be a content option.

    2.) That can be enabled for pages / news, but then you have to run around offering conversion boxes for everything. Some settings may only apply for a specific language, contact form should send to different places, etc. The “Ionize” approach only really helps for the page / news content stuff but leaves us guessing how to implement everything else.

    Oh and about the comment

    “finally some serious CMS using CodeIgniter came out”

    Remember that PyroCMS has been open-source for over a year, was the first to reach popular usage and was even out before IonizeCMS 😉

  • #164 / May 05, 2010 4:24am

    Hi guys,

    Phil Sturgeon thanks for this great PyroCMS, I have been using for 1 month and I already used in my three projects, developing my own modules for my projects. It is easy to use and easy to develop modules. recently working on bugs on my own modules.

    To say shortly, the latest version of PyroCMS is really great.

    One question, where we can find changelogs of each version? I need to see what was changed?

    Thanks a lot

  • #165 / May 05, 2010 5:38am

    Phil Sturgeon

    2889 posts

    Hi guys,

    Phil Sturgeon thanks for this great PyroCMS, I have been using for 1 month and I already used in my three projects, developing my own modules for my projects. It is easy to use and easy to develop modules. recently working on bugs on my own modules.

    To say shortly, the latest version of PyroCMS is really great.

    One question, where we can find changelogs of each version? I need to see what was changed?

    Thanks a lot

    You can find a Change-log in the offline and online documentation.

    http://pyrocms.com/documentation/general/change-log

    or

    docs/CHANGELOG.txt

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases