Code Monkey home page Code Monkey logo

Comments (14)

goFrendiAsgard avatar goFrendiAsgard commented on July 29, 2024

There is. You need to code the horizontal dropdown menu by yourself.
Basically, there are $cms['navigations'] and $cms['navigation_path'], which you can access from theme's view (e.g: themes/neutral/views/layouts/default.php)

Those two variables are used to build menu. In the default scenario, In the already exists scenario, I use build_menu function that can be found at theme/neutral/lib/function.php

What you need to do is either make a new function or edit the existing one to generate a drop down menu. Below is the example of $cms['navigations'] and $cms['navigation_path']:

$cms['navigations']:

array(10) {
  [0]=>
  array(10) {
    ["navigation_id"]=>
    string(2) "16"
    ["navigation_name"]=>
    string(10) "main_index"
    ["title"]=>
    string(4) "Home"
    ["description"]=>
    string(30) "There is no place like home :D"
    ["url"]=>
    string(10) "main/index"
    ["is_static"]=>
    string(1) "0"
    ["active"]=>
    string(1) "1"
    ["child"]=>
    array(0) {
    }
    ["allowed"]=>
    string(1) "1"
    ["have_allowed_children"]=>
    bool(false)
  },
  ......
}

$cms['navigations'] consists of the whole menu structure. You might be interested of "url" key which is the url pointed by the menu. Also, "allowed" value will be "1" if it the menu should be appeared. The "child" key will be consists of sub menus (with the same structure as $cms["navigations"] itself.

$cms['navigation_path']

array(1) {
  [0]=>
  array(4) {
    ["navigation_name"]=>
    string(10) "main_index"
    ["title"]=>
    string(4) "Home"
    ["description"]=>
    string(30) "There is no place like home :D"
    ["url"]=>
    string(10) "main/index"
  }
}

This is the "path" to the menu (e.g: if you browse to "blog | manage blog | manage article", the $cms['navigation_path'] will be consists of 3 elements of array).

You can always perform this script in your theme's view:

                <?php 
                echo '<pre>';
                echo var_dump($cms['navigations']);                 
                echo '</pre>';
                echo '<pre>';
                echo var_dump($cms['navigation_path']);
                echo '</pre>';
            ?>

Please tell me if you have some problem doing this :)

from no-cms.

konradb90 avatar konradb90 commented on July 29, 2024

Thanks for your help. Everything is going well so far but I have one question. Where the variables are created $cms['navigations'] and $cms['navigation_path']:
Or, how to create a new one? Example: $cms['navigations_horizontal']

from no-cms.

konradb90 avatar konradb90 commented on July 29, 2024

Ok, work good ;) Thanks. http://i47.tinypic.com/2hxalfo.png

I also wanted to do two navigations. One horizontal and one vertical. But it's probably working for hours;)

from no-cms.

goFrendiAsgard avatar goFrendiAsgard commented on July 29, 2024

You don't need to create the new one, what you need is to change how it is presented. So just use $cms['navigations']. There is no need to make $cms['navigations_horizontal'], except you have a good reason for it.

The content of $cms['navigations'] is taken from cms_navigation table.

But if you want to know, you can check application/core/CMS_Controller.php I have view method which is also make $data['cms']['navigations']. This variable is then parsed as $cms['navigations']

from no-cms.

goFrendiAsgard avatar goFrendiAsgard commented on July 29, 2024

Good work, @Konradinho.

So the dropdown menu is not taken from the database? if it is the case, you can simply modify the theme instead of using two navigation variable.

from no-cms.

konradb90 avatar konradb90 commented on July 29, 2024

The menu is retrieved from the database table cms_navigation. Only changed the css style for "ul" and "li". This is your standard navigation so that in the Polish language :)

from no-cms.

goFrendiAsgard avatar goFrendiAsgard commented on July 29, 2024

@Konradinho : Oh, I see :) You might also like to check assets/nocms/languages, and make "polish.php". Then you can use wysiwyg editor, and change the language into polish. It is an undocumented feature :p.

from no-cms.

konradb90 avatar konradb90 commented on July 29, 2024

Thanks for your help. I'll still have to modify wysiwyg editor to make it work well. Regards;)

from no-cms.

goFrendiAsgard avatar goFrendiAsgard commented on July 29, 2024

Hi, seems that your not-working wysiwyg is a serious problem. This is related to my default configuration which make gzip compression by default. You can have a quick-fix by editing application/config/config.php, go to line 318, change this line:

$config['compress_output'] = TRUE;

into this:

$config['compress_output'] = FALSE;

Or you might prefer to download the newest one of No-CMS, since I've already fix it

from no-cms.

goFrendiAsgard avatar goFrendiAsgard commented on July 29, 2024

You might want to check new themes: https://github.com/goFrendiAsgard/No-CMS/tree/338b726ba39bf00c3650265d798a741170dba634

from no-cms.

konradb90 avatar konradb90 commented on July 29, 2024

Good work, management easier than ever. But I'll save my drop-down menu ;)

from no-cms.

goFrendiAsgard avatar goFrendiAsgard commented on July 29, 2024

Do you mean thumbnail image of the theme?
I think it is not easy. But let's see,.... :)

from no-cms.

konradb90 avatar konradb90 commented on July 29, 2024

Creating image thumbnails when upload using grocery crud ;) No image theme ;)

from no-cms.

goFrendiAsgard avatar goFrendiAsgard commented on July 29, 2024

Oh, I see. that sounds reasonable :)
Thank's for your suggestion...

from no-cms.

Related Issues (20)

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.