Jump to content

Starsite qustions


justnew77
 Share

Recommended Posts

COMING FROM MODX

Link1: You've been using MODX but now you've found ProcessWire. It’s
totally amazed you and you can’t wait to get started. But…you are
wondering where everything is. If this is you, read on…
http://processwire.c...ning-from-modx/



Link2: A MODX refugee: questions on features of ProcessWire
http://processwire.c...of-processwire/

 

Link3: Code comparison between modx and processwire.

http://processwire.c...ge-2#entry30349

More here:

http://processwire.com/talk/topic/4173-grouped-forum-posts-links-articles-tutorials-code-snippets/

  • Like 3
Link to comment
Share on other sites

Thank you all for the links. I think they could help me.

I read the "getting started" tutorial but I still can't figure out what I wrote in my first psoting:

I got the start site next to the Icon with the Little house. When i create a new page it is UNDER the start site.

The start site contains the demo site an demo template with ist not changeable.

So how can I Change this?

Link to comment
Share on other sites

Your're looking at the page tree of ProcessWire. It represents the structure you also see on the page itself. As you mentioned, the first Page (/) with the house icon is the start site. You can't delete this page, because everything within PW is a child of this (even the admin pages itself).

In the default installation, this page has the template "home". You could change this but you don't have to (and also it will cause trouble with permissions...).

In the PW admin, go to Setup->Templates to change the fields of the home template. Open Setup->Fields to edit or add new fields you want to use in the home template. We can find the template file for home under the template directory in the PW installation path: /site/templates/home.php . Open it and you will see the markup for the start page. As in the tutorials, you can change everything here and build your own customized start page.

Basically, you just overwrite the default home template with your own fields and templatefile.

You could try to just download the blank profile  and instead of installing a fresh PW, just replace the content of the site/templates folder. After that, you can delete all example pages from the admin and customize the home template.

  • Like 7
Link to comment
Share on other sites

Hi,

i want to render out a navigation menu!

I got 3 pages: Start/Home, About and Contact.

I installed the MarkupSimpleNavigation modul and tryed this:

<?php
$treeMenu = $modules->get("MarkupSimpleNavigation"); 
echo $treeMenu->render(); 
?>

But it lists only 2 pages. The home/start page ist not in the list. Why?

BTW:
How can I say the Module what css class he should use

Link to comment
Share on other sites

From the documentation of the module https://github.com/somatonic/MarkupSimpleNavigation#markupsimplenavigation-116

$options = array(

    'parent_class' => 'parent',
    // overwrite class name for current parent levels

    'current_class' => 'current',
    // overwrite current class

    'has_children_class' => 'has_children',
    // overwrite class name for entries with children

Those are the options that let you modify classes, check all the other options also. They are many :)

  • Like 1
Link to comment
Share on other sites

Ok now it shows the "root page" correctly. But he did not add the class to the LI

I do it so:

$treeMenu = $modules->get("MarkupSimpleNavigation"); 
		
$options = array(
'parent_class' => 'menu',
'current_class' => 'active',
'show_root' => true
);
echo $treeMenu->render($options); 

But it renders out like so:

<ul>
<li><a href="/dev/">Home</a></li>
...

Without a class Parameter for the parents. (Current class do work)

Link to comment
Share on other sites

There's no need for a module. Take a look in the example code of the default PW installation.

If you only need a simple list:

<ul id="menu">
<?php		
	$homepage = $pages->get("/"); 
	$children = $homepage->children;
	$children->prepend($homepage); 
		
	foreach($children as $child) {
		$class = $child === $page->rootParent ? " class='active'" : '';
		echo "<li><a$class href='{$child->url}'>{$child->title}</a></li>";
	}

?>
</ul>
  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...