1

(11 replies, posted in Questions)

chirho wrote:

...
Thanks, Awilum. I saw this article. But when I change the URL in the admin panel and move the .htaccess file to the root folder, the css is not working. I also changed the RewriteBase rule to "/"

Maybe I don't understand the RewriteBase rule. Do you have an example?

Thanks for your support

that is hopefully not a cache issue?
try deleting the tmp files (admin->system)...

2

(10 replies, posted in Questions)

this small 'Page::available()' func. (nor the org. template below) doesn't use the page fields: 'status' and 'access'

you may have to add some mods...
for instance the template at plugins/box/pages/views/frontend/available_pages.view.php

<ul>
<?php
  foreach ($pages as $page) {
    if ($page['status'] == 'published') {
?>
    <li><a href="<?php echo $page['parent'].'/'.$page['slug']; ?>"><?php echo $page['title']; ?></a></li>
<?php
    }
  }
?>
</ul>

3

(10 replies, posted in Projects)

some professional background info is cool,
but that ^ was no demand from me smile

4 2013-02-28 20:05:30

(10 replies, posted in Projects)

..., this is a problem ?

well, no! - but i'm not that kind of doctor...

call it class-library, class framework, toolbox or just php files ...
there are many types of frameworks... of course, the new gelato is not a mvc-fw like fuelphp, mako, ... (was bookmarked)

but the point seems: the monstra helper classes are all in gelato wink
and if you use phpdoc and bootstrap, all the documentation looks pretty similar...

i've read some of monstra history here in the forum...
stumbled across diff. sites, like template-cms.org and template-cms.ru which are now monstra.org, but never looked deeper at the old projects sites (forum and sourceforge), nor in ever singel source file...

but nice to get a little history... (found nothing on the monstra site -  n.p.)
nevermind, i was just expecting simple yes/no answers big_smile

5

(0 replies, posted in Snippets)

mainmenu snippet:

<ul class="nav nav-tabs nav-stacked">
<?php
    // check for menu title
    if (isset($title)) {
?>
        <li class="title"><a><?php echo $title; ?></a></li>
<?php
    }
    // check for a given item category
    if (isset($category)) $category = (string)$category; else $category = '';
    // display menu
    Menu::get($category);
?>
</ul>

add to your theme styles:

.nav-tabs > .title > a,
.nav-tabs > .title > a:hover {
  color: #ffffff;
  background-color: #0088cc;
}

usage:
(no category = default menu)

    <div class="span3">
        {snippet get="mainmenu" category="category-name" title="Menu Title"}
    </div>

6

(0 replies, posted in Snippets)

carousel snippet:

<?php
    // you have to specify a folder
    if (isset($folder)) {
        $carousel = File::scan($folder, array('jpg', 'png','gif'));
        $id = Text::random('alpha');
?>
<div id="<?php echo $id; ?>Carousel" class="carousel slide">
  <ol class="carousel-indicators">
<?php
        for($i=0; $i < count($carousel); $i++) {
?>
          <li data-target="#<?php echo $id; ?>Carousel" data-slide-to="<?php echo $i; ?>"<?php if ($i == 0) echo ' class="active"'; ?>></li>
<?php
        }
?>
  </ol>
  <!-- Carousel items -->
  <div class="carousel-inner">
<?php
        for($i=0; $i < count($carousel); $i++) {
?>
          <div class="<?php if ($i == 0) echo 'active '; ?>item"><img src="<?php echo Option::get('siteurl') . $folder . DS . $carousel[$i]; ?>"></div>
<?php
        }
?>
  </div>
  <!-- Carousel nav -->
  <a class="carousel-control left" href="#<?php echo $id; ?>Carousel" data-slide="prev">‹</a>
  <a class="carousel-control right" href="#<?php echo $id; ?>Carousel" data-slide="next">›</a>
</div>
<?php
    }
?>

usage:

{snippet get="carousel" folder="public/uploads/gallery"}

info:
based on the lightbox carousel. (so this plugin is required, but only for the js trigger[¹])

tested against a default monstra 2.1.3 install and while doing this, i noticed, these indicators seems to require bootstrap 2.3.0, so replace it and delete the tmp files (admin->system)
(the lightbox plugin uses these indicators also...)

[¹]carousel js trigger:

$(document).ready(function(){
    $('.carousel').carousel();
});

7

(10 replies, posted in Projects)

i really love ice cream big_smile

so, basically you're separating the monstra helpers to a singel framework?
(are the new classes a rework of the makofw libs??)

8

(8 replies, posted in Questions)

another confusing way could be:
pages: name(slug)[¹]

- maintitle1(mainpageone)
 →  pagetitle1(mainpage/pageone)
 →  pagetitle2(mainpage/pagetwo)
- maintitle2(mainpagetwo)
 →  pagetitle1(mainpagetwo/pageone)
 →  pagetitle2(mainpagetwo/pagetwo)
- maintitle3(mainpagethree)
 →  pagetitle1(mainpagethree/pageone)
 →  pagetitle2(mainpagethree/pagetwo)

default menu: name(link,branch)

menutitle1(,ddmenutest)

ddmenutest menu: name(link,branch has to be empty - since one level only ...)

ddmenutitle1(mainpageone,)
ddmenutitle2(mainpagetwo,)
ddmenutitle3(mainpagethree,)

[¹] pseudo-pages - not possible at the time, see here

image with submenu:

download: ddmenu-2-plugin.zip (17K)
note: only tested against a default monstra 2.1.3 installation...

9

(10 replies, posted in Questions)

looking through the page.plugin code...

echo Page::available();

is this the one you want??
but as i understood, it's without sorting at the time...

anyway, have a look here

10

(0 replies, posted in Snippets)

snippet:

<?php
    function snippet_submenu() {
        // get the current subpages
        $pages = Page::children(Pages::$requested_page);
        // try to get the parent
        if ( ! isset($pages)) {
            $current_page = Pages::$requested_page;
            $parent_page = '';
            if ($current_page !== 'error404') {
                $page = Pages::$pages->select('[slug="'.$current_page.'"]', null);
                // try again if we have a parent                
                if (trim($page['parent']) !== '') {
                    $parent_page = Pages::$pages->select('[slug="'.$page['parent'].'"]', null);
                    $pages = Pages::$pages->select('[parent="'.(string)$parent_page['slug'].'"]', 'all');
                }
            }
        }
        return $pages;
    }
    $sub_pages = snippet_submenu();
    if (isset($sub_pages)) {
?>
        <ul class="nav nav-pills">
<?php
        foreach($sub_pages as $page) {
            $li_class_active = '';
            if (Pages::$requested_page == $page['slug']) $li_class_active = ' class="active"';
?>
            <li<?php echo $li_class_active; ?>><a href="<?php echo Site::url() . $page['parent'] . '/' . $page['slug']; ?>"><?php echo $page['title']; ?></a></li>
<?php
        }
?>
        </ul>
<?php
    }
?>

usage:

{snippet get="submenu"}

11

(8 replies, posted in Questions)

mh, not quite sure what you mean...

Now only children highlighted and not parent.

a parent gets also active, see example below (reload the screenshot, now it's with a mouse pointer):

pages: name(slug)
-   pagetitle1(pageone)
 →  pagetitle2(pageone/pagetwo)
 →  pagetitle3(pageone/pagethree)
default menu: name(link,branch)
pagetitle1(pageone,menutest)
menutest menu: name(link,branch has to be empty - since only one level ...)
pagetitle1(pageone,)
pagetitle2(pageone/pagetwo,)
pagetitle3(pageone/pagethree,)


is it possible to leave only parent with class='active', but not children?

if you want to have only the parent active, try this mod (it's the part above the code you posted):

            $item['descripton'] = Html::toText($item['description']);
            $pos = strpos($item['link'], 'http://');
            if ($pos === false) {
                $link = Option::get('siteurl').$item['link'];
            } else {
                $link = $item['link'];
            }
            if (isset($uri[0]) && $uri[0] !== '')  {
                if (in_array($item['link'], $uri) && trim($item['branch']) !== '') {
                    $anchor_active = ' class="current" ';
                    $li_active = ' class="active"';
                } 
            } else {
                if ($defpage == trim($item['link'])) {
                    $anchor_active = ' class="current" ';
                    $li_active = ' class="active"';
                }
            }
            if (trim($item['target']) !== '') {
                $target = ' target="'.$item['target'].'" ';
            }
            // get the default category

12

(9 replies, posted in Projects)

love those parallax effects big_smile

but this content slider seems not responsive on phones yet...
(.visible-tablet, .visible-desktop ...)

13

(4 replies, posted in Plugins)

thx nakome!

i noticed the video is still playing if i close the lightbox... big_smile
// edit: fixed in v1.0.3

14

(4 replies, posted in Plugins)

Bootstrap Lightbox

just testing my first shortcode lightbox plugin...
caption is optional
default toggle-image class is 'thumbnail', if no custom toggle is set...

{lightbox image="public/uploads/pics/image.jpg" caption="Your caption here"}
{lightbox image="public/uploads/pics/image.jpg" toggle="demoLightbox"}
<a class="btn" data-toggle="lightbox" href="#demoLightbox">View details »</a>
{lightbox carousel="public/uploads/gallery/folder"}
{lightbox_create image="public/uploads/pics/image.jpg"}
    {video webm="http://video-js.zencoder.com/oceans-clip.webm"}
{/lightbox_create}

info: A simple lightbox plugin based on the bootstrap modal plugin.
download: lightbox-plugin.zip (8K)

// edit: 1.0.2 added content mode (see video.js e.g. ^) and bootstrap carousel
// edit: 1.0.3 videojs pause check on hidden

15

(8 replies, posted in Questions)

i made some small mods, to show a bootstrap dd-menu ...

tested against monstra 2.1.3, only one level is possible...

ddmenu-plugin.zip (11K)

16

(2 replies, posted in Plugins)

ace is a really nice editor, but may not be the right choice for wysiwyg lovers...
i tested this plugin (at present) only in chrome with a default montra 2.1.3 install...

i used the current pre-packaged version (src-min-noconflict).
it's for most textareas in admin area: (mode in brackets)
pages (php), blocks(php), templates(php), chunks(php), styles(css), scripts(js), snippets(php)

@RomanArt
you had actually posted a picture of this editor before...
// edit:
sorry, it's maybe a sublime text editor screenshot?, anywar, you may try the monokai or twilight theme wink

17

(2 replies, posted in Plugins)

Ace

instead of the default 'markItUp!' editor.
this is my first post, first plugin and first version.
based on the markItUp! code.

info: Ace - The High Performance Code Editor for the Web
note: make sure to uninstall the 'markItUp' editor.
download: ace-plugin.zip (227K)

//edit - version 1.0.1 - moved js to sep. file to reduce html-head
//edit - version 1.0.2 - added ctrl-s to save and exit...