[new module] MiniCMS
serbanc
Joined: 2006-05-19
Posts: 314 |
Posted: Tue, 2008-10-28 09:37 |
dear all, available at www.e-poze.ro/downloads, two versions: for G2.2 and for G2.3. minicms-2.3.zip and minicms-2.2.zip I will make a codex page if time allows. Your feedback on it is important. serbanc - www.e-poze.ro |
|
Posts: 2
Serbanc,
Thanks for the module! I seem to be having a problem loading the tinymce editor for this module and htmlblock in Gallery 2.3. The error is that the tinyMCE is not defined. This could be realted to the combined javascript with the new version of Gallery, but everything else works OK.
Do you have this same problem, would you happen to have updated modules?
Cheers,
Ian
Posts: 314
unfortunately, I had no time to update the docs.
for G2.3 I received the same error and I also assumed that is because of the combined javascript.
quick hack: go to minicms/templates/tinymce.tpl and un-comment the first line.
so to say: load the tinymce javascript from the .tpl
regards.
[edit] - prepared in the /downloads section a version for G2.2 and another one for G2.3
serbanc - www.e-poze.ro
Posts: 2
Serbanc,
It's not commented, if you are referring to <script language="javascript" type="text/javascript" src="modules/minicms/tiny_mce/tiny_mce.js"></script>
I used 2.3 from your downloads section.
Do you know what the fix would be for the htmlblock?
Cheers,
Ian
Posts: 314
uncommented and still not working ? strange! I will look closer once more!
for htmlblock:
comment the line with $template->javascript(... in FileEdit.inc
then in templates/FileEdit.tpl add a similar line with <script .. putting the correct path to tiny_mce.js (copy it from FileEdit.inc)
Enjoy,
serbanc - www.e-poze.ro
Posts: 27300
serbanc, thanks for the contribution.
This is a big improvement over html block.
Started one:
http://codex.gallery2.org/Gallery2:Modules:minicms#Usage
but it needs some fleshing out.
ANYBODY: feel free to edit as you see fit. The docs are for the users-by-the-users. So you get what you contribute.
Please help out so developers can make improvements to the modules and not spend time on documents.
-----
I added G2image (a image browser to add html to posts) on my test setup from:
http://g2image.steffensenfamily.com/index.php?title=Download
and works well. Perhaps you can install it with your module in a future release.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 3
is it possible to have a post appear as the 1st page on the gallery? i want to have a splash screen with no albums and then have the user login and see the galleries below the tinycms post.
Posts: 314
yes, it is possible.
quick: look at the htmlblock codex page (http://codex.gallery2.org/Gallery2:Modules:htmlblock), see the solution there, replace "htmlblock.RenderFile" with "minicms.Show"
longer: I will update the codex page !
serbanc - www.e-poze.ro
Posts: 154
It is possible change in url rewrite module 'show/%articleId%' with 'show/%title article%' ?
Posts: 314
yes, it is possible, but it will require coding.
it is not possible by default.
serbanc - www.e-poze.ro
Posts: 154
I would like to help, but not familiar with the code and syntax.
Posts: 314
Unfortunately, I am busy with other projects for the moment, so I cannot help.
Maybe by asking some questions in the forum you can find some guidance.
serbanc - www.e-poze.ro
Posts: 154
I have the same problem of NextLevel. Not tinyMCE, in addition not work 'default' and 'delete'.
The line <script language="javascript" type="text/javascript" src="modules/minicms/tiny_mce/tiny_mce.js"></script> is uncommented.
I read that you are busy. Reply when you can and excuse bad english.
EDIT: strange .If i install 'rating' module all work
URL di Gallery = http://www.alefoto.it/main.php
Versione di Gallery = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
Versione PHP = 5.2.5 apache2handler
Webserver = Apache/2
Database = mysql 5.0.37-standard, lock.system=flock
Strumenti = ArchiveUpload, Getid3, Thumbnail, Gd, LinkItemToolkit, Exif
Accelerazione = none, none
Sistema operativo = Linux growl.netjaguar.com 2.6.18-53.1.14.el5PAE #1 SMP Wed Mar 5 12:07:47 EST 2008 i686
Tema predefinito = PGtheme
gettext = abilitato
Locale = it_IT
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16 GoogleToolbarFF 3.0.20070525
Posts: 314
yeap, noticed that there is a problem with "delete" - it deletes, but it jumps to default page.
should be simple - prob a typo error, I will take a look.
Regards,
serbanc - www.e-poze.ro
Posts: 2
Hello all,
can i create an article as my homepage ?
thanks for responses
Posts: 2
up please
Posts: 314
please take a look in the codex, it explains how to put an article on the homepage.
please note that it requires modification in main.php.
as minicms replaces htmlblock, looking there might also be helpful
serbanc - www.e-poze.ro
Posts: 10
Hey there. Great module. But I have a formatting problem.
I made an article and made it show up in the sidebar. The
article contains links, and the links get a very tiny font
for some reason. I tried all kind of formatting and style
settings in TinyMCE, but the fontsize never changes.
Non link text is formatted alright.
Do you have any suggestions?
Posts: 10
Okay, never mind, the theme I'm using is overriding somehow
certain TinyMCE formatting.
Posts: 154
Two questions:
1)Can I add a sidebar on a article created with minicms?
2)Can i rewrite the url from http://www.mysite/show/xxxx to http://www.mysite/'title article'? (like WP)
Posts: 314
1. what do you mean ? gallery's sidebar or another sidebar ?
Gallery's sidebar is displayed anyway by the theme (unless you set the flag to full screen)
in the second case a [very] simple sidebar could be
<table>
<tr>
<td>
{g->block type="minicms.ArticleBlock" articleId=123456} {* the id of sidebar article *}
</td>
<td>
the content of the main page
</td>
</tr>
</table>
serbanc - www.e-poze.ro
Posts: 154
I want gallery's sidebar, This is my page with Minicms on Pgtheme
http://www.alefoto.it/show/9917
Flag to full screen is not select but gallery's sidebar not view (excuse bad english)
Posts: 314
but pgtheme does have a sidebar ? perhaps you should display it manually ....
serbanc - www.e-poze.ro
Posts: 154
I did a test, I changed the theme to my gallery and I used matrix theme , the sidebar appears.The problem is in PGtheme.
Can i change the theme only for MiniCMS?
Or can I add the sidebar in the template MiniCMS?You know the call for the sidebar?
Have you other solutions to be proposed?
Sorry bad english and thanks in advance.
Posts: 314
1. nope - the theme cannot be set only for minicms
2. you can "fake" some sort of sidebar, by creating a design that mimics that.
Simplest, a table with two columns, left td contains sidebar, right td contains the content
3. you cannot call the sidebar directly, you have to load the blocks manually, one by one: {g->block type="module.block" <params>}
Enjoy
serbanc - www.e-poze.ro
Posts: 8
Hi Serban,
i want to create some kind of Top Menu for my site.
i thought im going to do this by creating an article with links and displayed it using {g->block type="minicms.ArticleBlock" articleId=XX} on top of my page. i can do this with no problem.
now, i want to create the articles that those links linked to (eg. about, FAQ, etc). but i cant seem to display them unless it is rendered in full page which i don't want. even in the links that minicms provide in the cms admin.
i have a hunch this is related to the theme that im using, but i cant figure it out somehow.
any ideas?
note: i've tried meddling with main.php like what you said in the htmlblock thread but still nothing.
Posts: 118
How do I display my article as top menu item? (near login, your album etc.)
How do I display it only on some pages like "photo pages" in a left column side (I use matrix theme)?
Thanks, I searched the forum and found only basic install info. I can write the articles but how do I integrate and position (in template management tab) in gallery2
Posts: 314
- neither minicms neithe htmlblock were not designed to be displayed only on photo/album/whatever page - sorry. add an {if} to acccomplish this.
- as top menu: add in your theme something like {b->block type=.....}
please note that {g->block ... ArticleBlock ...} will render some content in a page, whether {g->url arg1="view=minicms.Show" arg2="articleId=12345"} will display (when clicked!) the respective article on a page (with or without header)
Posts: 118
Thanks I edited my theme.tpl (for matrix theme) and placed code in
<div id="gsNavBar" class="gcBorder1">
<div class="gbSystemLinks">
{g->url arg1="view=minicms.Show" arg2="articleId=2252"}
{g->block type="minicms.ArticleBlock" articleId=2252}
{g->block type="core.SystemLinks"
order="core.SiteAdmin core.YourAccount core.Login core.Logout"
othersAt=4}
</div>
However I see actual non clickable article link or actual text in article
Also do you know how can display an article on my gallery2 homepage?
Now I see something like "This album is empty".
Posts: 314
smilem, your are close
<a href="{g->url ...}">some text</a>
and use the construction with minicms.Show
serbanc - www.e-poze.ro
Posts: 118
Thanks, I used <a href="{g->url arg1="view=minicms.Show" arg2="articleId=2252"}">FAQ</a>
Do you know how to replace the "homepage" with one of articles from miniCMS? What file to edit and how?
Posts: 314
glad it worked.
check the codex (post by floridave); in the codex, there is a recipe. you have to modify main.php.
enjoy!
serbanc - www.e-poze.ro
Posts: 118
I searched the codex for main.php and found nothing.
However I have different question what is the nice menu you are using on your website, how does it change based on language?
If I use above method like you gave me I will be unable to change the "link name" and "content" based on user language like I can with other gallery modules. How did you solve this on your site?
Posts: 314
sorry for misguiding.
quick: look at the htmlblock codex page (http://codex.gallery2.org/Gallery2:Modules:htmlblock), see the solution there, replace "htmlblock.RenderFile" with "minicms.Show"
nice menu:
classic html/css dropdown menu. The menu is attached to a dummy module, just for language translation ({g->text .... })
link name will change with site language (if coded with {g->text...}). however, not the same for content.
alternatively, you can use:
{capture assign="lang"}{g->language}{/capture}
{if $lang == "ro-RO"}
{assign var="artid" value="123"}
{else}
{assign var="artid" value="456"}
{/if}
...
{g->url arg1="view=minicms.Show" arg2="articleId=$artid"}
...
serbanc - www.e-poze.ro
Posts: 118
I created the frontpage.tpl and placed it in my themes/matrix/templates/
{* display the systemlink *}
{g->block type="core.SystemLinks"}
{* display an image *}
<div>
{g->block type="imageblock.ImageBlock" blocks="specificItem" maxSize="400"
itemId=123456 useDefaults=0 showDate=0 showViews=0 showOwner=1 showTitle=1 }
</div>
{* display a HTML file *}
<div>
{g->block type="minicms.ArticleBlock" articleId=2217}
</div>
{* say hello to your user *}
<div>
{capture name="lang"}{g->language}{/capture}
{assign var="lang" value=$smarty.capture.lang}
{if $lang == "en-US"}
{assign var="greeting" value="Hello"}
{elseif $lang == "ro-RO"}
{assign var="greeting" value="Salut"}
{/if}
{$greeting} {$user.userName}
</div>
Then I edited the main.php
/* Load and run the appropriate view */
/* Serban: if not embedded and empty view, nor a path, nor an item specified
go to htmlblock.RenderFile, with no args, so it will take the default, FrontPage.tpl */
$rewritePath = (isset($_GET[GALLERY_FORM_VARIABLE_PREFIX . 'path']) ?
$_GET[GALLERY_FORM_VARIABLE_PREFIX . 'path'] : null);
$itemId = (int)(isset($_GET[GALLERY_FORM_VARIABLE_PREFIX . 'itemId']) ?
$_GET[GALLERY_FORM_VARIABLE_PREFIX . 'itemId'] : null);
$page = (int)(isset($_GET[GALLERY_FORM_VARIABLE_PREFIX . 'page']) ?
$_GET[GALLERY_FORM_VARIABLE_PREFIX . 'page'] : null);
if (empty($viewName) && !$gallery->isEmbedded() && empty($itemId) && empty($rewritePath) && empty($page)) {
$viewName='view=minicms.Show';
GalleryUtilities::putRequestVariable('view', $viewName);
}
/* Serban: end of changes for frontpage */
But now I get this error when I open my gallery2 front page:
Security Violation
The action you attempted is not permitted.
The even logs has this:
view=minicms.Show can't be parsed
Posts: 314
ok,
let's to the following.
in Admin->MiniCMS->create an article (whatever content) and assign it as default (D flag).
that's it.
serbanc - www.e-poze.ro
Posts: 118
I assigned the D flag but got the same error but with error details:
Error Detail -
Error (ERROR_BAD_PARAMETER) : view=minicms.Show can't be parsed
* in modules/core/classes/GalleryView.class at line 149 (GalleryCoreApi::error)
* in main.php at line 340 (GalleryView::loadView)
* in main.php at line 104
* in main.php at line 88
Posts: 314
G2 version ??
serbanc - www.e-poze.ro
Posts: 118
Gallery 2.3, did not update to 2.3.1 because my server still uses old php 5.1.6
Posts: 314
and you use the 2.3 version of minicms, right ?
can i have some apache logs ?
serbanc - www.e-poze.ro
Posts: 118
I sent you PM, here is my main.php
Posts: 314
correct $viewName line from
$viewName = 'view=minicms.Show';
to
$viewName = 'minicms.Show';
serbanc - www.e-poze.ro
Posts: 118
I update main.php like you said and now it works Thank you
It seems I don't need the frontpage.tpl in my template folder.
Also why do I get this apache error with miniCMS
[Mon Jan 18 13:23:46 2010] [error] [client xx.xx.xx.xx] File does not exist: /var/www/da-home/user/domains/domain.tld/public_html/foto/modules/minicms/tiny_mce/plugins/g2image, referer: http://www.domain.tld/foto/main.php?g2_view=core.SiteAdmin&g2_subView=minicms.AddArticle
Posts: 314
no, you do not need frontpage.tpl in tpl folder - that was for the htmlblock module. great that you solved it!
error - because either you do not have the g2image plugin for tinymce, either there is an error with g2image plugin (for tinymce)
serbanc - www.e-poze.ro
Posts: 118
Thanks for your help, so I can ignore the error I don't use tinymce anyway I use dreamweaver for code generation even on my joomla site.
Posts: 314
you are wellcomed!
anyway, what is your site ?
Posts: 118
You got PM
I wonder why if I add a table the
<td> </td>
is replaced with
<td>�</td>
I did not have this problem when used "aboutpage" plugin so it must be miniCMS problem
Posts: 314
noticed that-- it is a miniCMS problem, more specifically, tinymce one.
i did not developed/debugged/updated miniCMS anymore recently (1 yr ?)
but, I had htmlblock as base for this module. in the htmlblock's wiki, there are some user contributed changes related to tinymce version aso
you can easily follow those indications into miniCMS.
serbanc - www.e-poze.ro
Posts: 118
Could you point me a link to this wiki? also I don;t use tinymce at all
Also I'm looking for a way to show the default miniCMS article only to non registered and registered users, the admin should not see it. Otherwise it's impossible to adjust gallery permissions etc.
Posts: 118
I just replace the tinymce with the one from joomla cms and it did not make a difference. So the problem is not the tinymce like you said
It seems the characters are removed.
I also tried to make default tiniMCE page show only to guest use
/* Load and run the appropriate view */
/* Serban: if not embedded and empty view, nor a path, nor an item specified
go to htmlblock.RenderFile, with no args, so it will take the default, FrontPage.tpl */
{if $user.userName == 'guest'}
$rewritePath = (isset($_GET[GALLERY_FORM_VARIABLE_PREFIX . 'path']) ?
$_GET[GALLERY_FORM_VARIABLE_PREFIX . 'path'] : null);
$itemId = (int)(isset($_GET[GALLERY_FORM_VARIABLE_PREFIX . 'itemId']) ?
$_GET[GALLERY_FORM_VARIABLE_PREFIX . 'itemId'] : null);
$page = (int)(isset($_GET[GALLERY_FORM_VARIABLE_PREFIX . 'page']) ?
$_GET[GALLERY_FORM_VARIABLE_PREFIX . 'page'] : null);
if (empty($viewName) && !$gallery->isEmbedded() && empty($itemId) && empty($rewritePath) && empty($page)) {
$viewName = 'minicms.Show';
GalleryUtilities::putRequestVariable('view', $viewName);
}
{/if}
/* Serban: end of changes for frontpage */
but it show blank page instead. I sent you PM bout this.
PHP Parse error: syntax error, unexpected T_VARIABLE,
Posts: 118
I'm getting closer
It seems the tags were not for php file but for templates so I changed my code to look like this and don't get the error anymore, but the guest user is not recognised
if ( $user.isGuest ) {
$rewritePath = (isset($_GET[GALLERY_FORM_VARIABLE_PREFIX . 'path']) ?
$_GET[GALLERY_FORM_VARIABLE_PREFIX . 'path'] : null);
$itemId = (int)(isset($_GET[GALLERY_FORM_VARIABLE_PREFIX . 'itemId']) ?
$_GET[GALLERY_FORM_VARIABLE_PREFIX . 'itemId'] : null);
$page = (int)(isset($_GET[GALLERY_FORM_VARIABLE_PREFIX . 'page']) ?
$_GET[GALLERY_FORM_VARIABLE_PREFIX . 'page'] : null);
if (empty($viewName) && !$gallery->isEmbedded() && empty($itemId) && empty($rewritePath) && empty($page)) {
$viewName = 'minicms.Show';
GalleryUtilities::putRequestVariable('view', $viewName);
}
} else {
}