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

David posts

Feed 1493 posts

Getting current page URL/title

Thanks, Stewart! I suppose there’s always more than one way to skin the cat. When you mentioned a global variable solution, I put the thinking cap on and came up with this:

I dumped this into a snippet:

<?php // Grab page title and url
$_SESSION['pageTitle'] = $this->title();
$_SESSION['pageURL'] = $this->url();
?>

That’s called in the Layout. Then the inherited sidebars, etc., can simply echo them:

<p><?php echo $_SESSION['pageTitle']; ?></p>
<p><?php echo $_SESSION['pageURL']; ?></p>

(or whatever) for example.

I have no idea of the relative merits/pitfalls of these approaches! If any PHP gurus want to offer comment, that would be welcome.

 

Getting current page URL/title

I define global variables that store the title and url.

Genius! :) If you want to post your actual code (for layout and snippet), I’m sure there would be others happy to see it. Glad you sorted it! (The $_SERVER['REQUEST_URI'] method would be a bit cumbersome, truth be told…)

 

Getting current page URL/title

In inherited content, how can I find the current url and title?

Hi Stewart: In the “four-level collapsing nav” code in the Navigation Cookbook you will see one method you could adapt. Try sticking this bit of code in your snippet to see what it gives on on any given (inherited) page:

<p>The URI of this page is: <?php echo$_SERVER['REQUEST_URI']; ?>.</p>

To know exactly how to manipulate this for your purposes, one would need to know at what level (how many child-pages from Home, as it were) you are working with.

Is the site live where we can see what you’re wanting to do?

 

display page_part

Hi there – I’m still not 100% clear what you want to do! :) My fault, I’m sure!

But a solution to a different problem made me think of this one. Does the solution described here help you at all?

 

Point A Newbie

Should the file names like “unbound2frog.css”, become “screen.css” or “print.css”???

It doesn’t really matter, as long as whatever their name IS is the one that you call in your <link... line. The name is the name.

The point about the new “system” (using a different directory for each “theme”) is that — for themes set up in this system — you only need to change the directory name in your Layout to change the theme.

But meanwhile, just ensure you call a real directory with an actual name, and you should be fine.

 

List all page contents (page-parts)

…I already have complex structure for the menu…

I thought that must be the reason, or something like it. (There is still a way of doing it with pages, but … keep reading!)

I caught Philippe briefly for a chat this evening, and he gave me some help with this one (“merci!!”). You could try this code:

<?php foreach ((array)$this->part as $name => $part) : ?>
<li><?php echo $part->content_html; ?></li>
<?php endforeach; ?>

That will simply recursively give the content for every page_part you add. You can call them anything you like. ;) The only caution is that you will end up with the main “body” (default) part twice, but I’m sure there’s more than one way of dealing with that.

See how/if it works for you and let us know how it goes.

 

Point A Newbie

@homershines – there are plans (advanced!) to add a documentation wiki to the Frog sites that will help here, but for the moment, there are just the things that are scattered around the forum and on individual users’ sites.

I have ported a few of the themes myself, and I’m aware that some of them need updates and corrections! Which ones have you tried so far?

 

List all page contents (page-parts)

Hi Davide – I’m thinking about the answer to the question you ask … not sure just now!

But I am also wondering why you don’t just use pages for your new content. That works much, much easier than adding “tabs” — but I’m sure there is a complication I don’t understand!

Meanwhile, if you can use pages rather than page parts, you will find it is much easier. There is no problem pulling content from one “branch” onto another page. I did this using YouTube videos: you could have your “display” page pulling the weekly videos (or whatever) from a “Video” branch. The site is a bit of a mess, but you can have a look if you like.

 

Plugin i18n: Support for English language files?

Actually, I can recall one case where the ability to have an en-message.php file read would have been a great help. (There the issue was trying to accomodate a Kohana helper that used this approach into Frog’s plugin system.)

In this case, I think the point is that — however elegant and appropriate the original wording — this would allow for simple customization of existing strings. One could imagine, for instance:

'Message sent successfully.' => 'Let the bells ring and the banners fly!',

or whatever… ;)

 

Shopping cart plugin for Frog

oweb prepared nopcart for Frog. It was announced on the forum but I don’t know current status. Maybe oweb can update us?

 

Frog Cheatsheet

There’s just the beginnings of such things in the docs. When the wiki is launched (!), then it will be perfect for this sort of thing.

Meanwhile, we can use this thread to gather such tidbits so that when the wiki is launched, they can just be copied over.

 

external link

If you mean, “how do I add a link to an external site into my main navigation”, then just add it “manually”, like the “Home” link itself. Add it either before or after the foreach loop. This is the default Frog navigation code, with the options indicated:

 <div id="nav">
    <ul>
      <li><a<?php echo url_match('/') ? ' class="current"': ''; ?> href="<?php echo URL_PUBLIC; ?>">Home</a></li>
      <li><a href="http://enkelthed.dk/ukn/forum">Forum</a></li>    <---- OPTION #1
<?php foreach($this->find('/')->children() as $menu): ?>
      <li><?php echo $menu->link($menu->title, (in_array($menu->slug, explode('/', $this->url)) ? ' class="current"': null)); ?></li>
<?php endforeach; ?> 
      <li><a href="http://enkelthed.dk/ukn/forum">Forum</a></li>    <---- OPTION #2
    </ul>
  </div> <!-- end #navigation -->

Hope that helps!

 

Archive year index 404

And just to double check — I notice that you have put “Archive year index 404” for the the subject of this thread. But you are working with a month index URL. Have you got mis-matched “Page types”? (Check the drop-down box under the editing area of your index page.)

 

Archive year index 404

That looks strange, kesor! It looks as if you changed the page name from “articles” to “blog” correctly.

Did something get changed somewhere? You could check to see that the

%B %Y archive (Archive month index)

page still is a “child” page to your “Blog” page. Not sure what else to suggest!

 

Frog Shirt

I was wondering where the original artwork is located? …

“Artwork”! You called it “artwork”! What a compliment! :)

There is no location, so no, you aren’t blind. If you’re interested, shoot a note to madebyfrog at gmail dot com and I can send you something.

 

New Version .95 too many error checking

There is a wierd thing happening with the latest version of Filezilla…

If Filezilla is a problem, or might be, you could always try WinSCP and see how that works for you. I have both, but my “default” is WinSCP.

 

New Version .95 too many error checking

Hi JREAM:

It disables the entire site over the config being writable…

More precisely over having permissions set to 777. But 750 (rwxr-x---) is fine. Can’t you set it to that?

Then the files area is all different in theme categories,

That is just a different convention. The old 0.9.4 system still works fine, of course. The new system simply sets a “standard” for future development.

why would anyone change website themes that much where they need a theme folder?

Well, they might not! ;) But the advantage of the new system is that it keeps the themes area much tidier, and makes shoving in new ones much easier.

Is it safe to use .94 still?

I can’t see why not!

 

Plugin problem in 0.9.5

This has been noted at various places on the forum and in the issues list, but not everyone will see them!

It arises because of the removal of the backend/frontend split, and affects plugins that create a tab and sidebar in the admin. Basically, you want to look for a NameController.php or index.php file with a line something like this:

$this->assignToLayout('sidebar', new View('../../../plugins/plugin_name/views/sidebar'));

and change it to this:

$this->assignToLayout('sidebar', new View('../../plugins/plugin_name/views/sidebar'));

(removing ../) And that should take care of things.

 

Asset manager plugin

I have some free time at the moment so working on it.

cough! (tutorial) cough!

;) (Cheeky, I know!)

 

Pages and sub-pages (children)

Hi Kristjan –

Sorry I don’t have time for much more than quick replies just now. But the key to finding child-of-child pages is using something like this:

$this->find($child.'/'.$grandchild);

You can see how this works in the four-level collapsing nav code in the Cookbook. Hopefully that’s enough to get you going…!

 

Pages and sub-pages (children)

ou camon guys…can’t anyone help me?

Sadly, I had to spend a few minutes on my day job! ;)

But it would help to see what you’re trying to accomplish. Is your site live?

Perhaps the best thing to use would be to use peter_b’s “collapsing nav” that works to any level. You can find the code, and discussion about variations, here.

Hope that helps!

 

Asset manager plugin

I’m just doing a tiny bit of head-scratching … not sure how the mechanism of Assets works, but could another potential problem be the way a host’s PHP is configured? Might it affect the way Peter Gassner’s ImageResize works….?? Don’t know! Just thinking out loud…

 

Frog version 0.9.5 stable released

This is a superb step forward. Martijn deserves a huge vote of thanks, IMO! I see he even tidied up his personal site for the occasion. ;)

Nice work all round, Martijn!!

 

Renaming the Articles page, breaks the Home Page

i am doing something wrong or is this a bug??

Just follow these instructions and you will be fine. ;)

 

Contact Form breaks all plugins !

Hey Dave – could you shoot a note to madebyfrog at gmail dot com and I’ll get it right back to you.