FORUMS CLOSED DUE TO SPAM. YOU STILL CAN ADD POST!

David posts

Feed 1493 posts

Menu like this!

Hi jelm! Glad you like it so far.

The “problem” for your purposes with that (great!) “stacking” navigation system is that it produces nested lists, of course. You need something that produces a discrete list for each level of navigation.

I have been working on this, and have something that more-or-less works. It does not work for “Articles”/blog-type entries, but it works fine for “ordinary” pages and subpages. I have a test demo set up here if you want to take a look. (That link takes you to a page fairly deep into the menu system.)

If it looks promising, I can always share the code.

Or maybe others have a better “discrete list” menu system working…??

 

File has not been uploaded!

Check the permissions on the folder. It should work with either “0755” or “0751”. It depends on how things work on your host. Of course, it is always possible to FTP files directly, but it would be more convenient for Frog’s own file manager to do the job, of course!

 

Parse error: syntax error, unexpected '<'

Just curious … are you using TinyMCE? It doesn’t take kindly to encountering PHP, for instance. (Only wracking my brains trying to think what might cause this!)

On second thought, that can’t be it, if replacing index.php with a fresh one fixes things.

Bottom line (I think!) is that your index.php file should not be getting altered (so far as I can tell!).

Definitely something fishy, as you say…

 

Parse error: syntax error, unexpected '<'

Index.php gets more lines when your content is brought in.

??? I have about four 0.9.5 installs, and none of them show growth in index.php when “content is brought in”! Are you importing data into the database? or simply adding content to the site “normally” via the admin?

 

Set banner image conditional on parent

Your code, above, is 99.9% perfect ;) – it just fails on the home page.

Drat! >.< A tiny “if…” would take care of that last 0.1%! Meanwhile, I’m glad the other CSS solution is working for you. It does yeoman service for me. :)

 

Parse error: syntax error, unexpected '<'

Hmmm…. Odd one, since index.php does not (at least in the current 0.9.5 relase) have 91 lines!

Is the site live? What other things are you trying out with it?

 

Set banner image conditional on parent

… Trying it out now.

Waiting with bated breath! ;)

I can’t see how I’d do that with CSS unless the same ID was set on the body tag for the parent and all children of that parent.

That’s exactly how it’s done on my wife’s site — the code for it is in one of those previous threads noted above.

 

Set banner image conditional on parent

Actually, if the banner’s name is always going to be in the form of [banner-root-slug].jpg, then this would work:

<?php foreach($this->find('/')->children() as $topSlug): ?>
<?php if (in_array($topSlug->slug, explode('/', $this->url))) { $bannerName = $topSlug->slug; } ?>
<?php endforeach; ?>

<img src="<?php echo URL_PUBLIC; ?>public/images/<?php echo $bannerName; ?>.jpg" />

I tested that in a snippet called “banner”, added it to the layout and hey presto! Worked a treat. All you (or your client) has to do is ensure that the image name actually matches that of the “root” slug!

 

Set banner image conditional on parent

Hi David: There are three or four (not sure!) solutions in a couple of threads (I see you’ve been here before! ;).

Are you doing this with CSS? or with calls in the layout/html? I think most of the solutions in those threads are for CSS. But if you were doing this in the layout, then you could just use a page-part on the “BANNER-root” page (if you see what I mean!).

Update: And I see that some of these solutions won’t work, if the scenario is as in that previous thread! Is this a “feature” you’re going to let a client loose on?

 

Frog didn't install the tables in database

Hi again, fresh2!

Do you have access to phpMyAdmin? If so, it should report what version of mySQL it’s looking at. Look for a value something like:

Server version: 5.0.77-1

“Server version” being the key words.

 

template, layout and snippet editing

There has been chat about this on the forum before. You could see if that is any help.

You could also check out this thread on the Codepress plugin, which at least makes editing code in Frog’s admin less painful. ;)

 

syntax error, unexpected '{'

@fresh2 – it would really help to know more about your environment to try and help to solve this! Are you on localhost? what platform? or is this “live” hosting? Are you running current mySQL and PHP releases (although you shouldn’t need the absolute latest)? PDO situation? etc….

 

Q. How to generate Sitemap ?

I think the problem is where you are trying to set the root of your search. Set the “5th” line of the function back to the original:

$childs = $parent->children();

Then, at the end of the snippet code, change the echo routine so that the root of the search is set to your hidden page:

<?php echo snippet_xml_sitemap($this->find('fr')); ?>

and see how that works. (Then just change ('fr') to ('en') for the other part of your site, of course). Here’s hoping that does it!

 

Strange page layout issue

Hi again BlueFrog – I think we might be on the same page here. Because what I think you need for your page to be “found” (rather than 404!), is for $myvar to return /about-us/team, and not simply team.

 

Q. How to generate Sitemap ?

Did you try using these instructions ? It looks to me like the page isn’t being properly recognized as XML.

 

Strange page layout issue

My PHP knowledge is pretty shallow, but I wonder if this is like the issue that I had when trying to develop one of the navigation routines.

To find child-of-child-of-home pages, you have to do something like:

$this->find($level2.'/'.$level3);

That is, Frog is looking for two slug values for your “level 3”, and not just one. Is that a clue to anything for you?

 

[help] How To install new theme in cmsfrog?

Hi luf:

Basically — what jeCa said! :) But there is a tiny bit more info on the Google Code wiki. Hopefully that will help you understand what is involved.

But also as jeCa says, if you download one of the ported themes, they (usually!) come with installation instructions. And once you have installed one, you will know exactly what is invovled!

 

Q. How to generate Sitemap ?

Hi 5ubstance: the line of code in the post above yours should be the working version. Try it, and if you have problems, let us know what they are!

 

change comment order

Hi there:

Open up the the “comment-each” snippet, and find the second line:

<?php $comments = comments($this); ?>

and change it so it reads:

<?php $comments = comments($this); krsort($comments); ?>

That should do it! (I’m assuming you’re using 0.9.5, too.) Of course, that will change the sort order of ALL your comments that use this snippet! You can always create a new one, just for the “reverse” sort, if you want to leave the original newest-to-oldest sort in place.

Hope that helps!

 

Get parent page name?

Sorry thv20 – I haven’t had enough time on my hands or caffeine in my veins to wrap my head around this one. The thing about $this->parent() is that you don’t use it “on its own”. It returns an array of values for the parent of $this (so be careful it doesn’t get used for Homepage — that will throw errors!), so you could use something like:

<?php echo $this->parent->title(); ?>

for example. Meanwhile, glad you’ve found a solution that works for you!

 

Slovak translation

Added at to source at r442. Many thanks for the contribution!

 

Sub Menus

Hi Craig – Have you seen the solutions in the Cookbook? The first one is the simplest, but you can see the other strategies there, too.

There are one or two other solutions scattered in the forum. If you want help with a particular “style”, do ask again.

 

Plugin: (more) page metadata

Sounds helpful, M! I’m quite sure this will make some people happy! ;)

 

Plugin i18n: Support for English language files?

…for example SUCCESS_MESSAGE and then define the contents of the SUCCESS_MESSAGE in en-message.php.

Well — you could do it that way, of course. But with Frog’s “Help us translate Frog!” feature, it would be better to simply put your default strings into the __('Construct') so that other translators will know better what to translate. (IMO, of course!)

 

Plugin i18n: Support for English language files?

So is there any comment on whether this can/should/will be implemented in Frog?

All it would require is commenting out line 70 of /frog/helpers/I18n.php:

if (I18n::getLocale() != DEFAULT_LOCALE)

I can only see advantages here, and can’t see any disadvantages. If there is no en-message.php file in the i18n directory, you will just get the default strings. If there is an en-message.php file, then you get the replacement strings.

For me, the advantages outweigh the disadvantages. But then again, I don’t know what the disadvantages are! :P If there are some, it would be good to know!