
ngrmm
Members-
Posts
474 -
Joined
-
Last visited
-
Days Won
3
Everything posted by ngrmm
-
i want to output a menu with just one dropdown-option and an class="active" if the user is on the active page this is my tree – root –– page A –––– child page A –––– child page A –––– … –– page B ––– child page B ––– child page B ––– child page B –– page C ––– child page C ––– child page C and the output should be like this –– page A (just dropdown, no link! just text) –––– child page A (link) –––– child page A (link) –––– … –– page B (link) (children should not be listed) –– page C (link) (children should not be listed) and if the current page matches A, B and C matches on any level a class should be added to page A or B or C this my code so far but i dont how to make page B and C an link and page A just text and how not to output the children of page B and C <?php $root = $pages->get("/"); $children = $root->children(); foreach($children as $child) { $class = $child === $page->rootParent ? " class='on'" : ""; echo "<li $class ><a >{$child->title}</a>"; echo "<ul>"; foreach($child->children as $grandchild) { echo "<li ><a href='{$grandchild->url}'>{$grandchild->title}</a></li>"; } echo "</ul></li>"; } ?>
-
i solved it this was: $articles = $pages->find("template=photo|video, highlight=1, sort=created, "); $articles_2 = $pages->find("template=photo|video, highlight=0, sort=created, "); … but it seems there could be a better way with less code
-
i'd like to have a list of pages sorted by „creation“. $articles = $pages->find("template=x|y, sort=creation"); all the pages have a checkbox-field. the name of the checkbox-field is highlight. and it is a autojoin-field. i want all the highlight-pages listed above the others i don't know how to handle checked and not checked as a value this doesn't work $articles = $pages->find("template=x|y, sort=highlight, sort=creation" );
-
thx diogo $gp = $pages->get(1016); $children = $gp->children; $articles = $pages->get("parent={$children}, sort=title"); foreach($articles as $article) { echo $article->title; } but it doesn't work maybe because $children is an array?
-
this is my code $gp = $pages->get(1016); $children = $gp->children; foreach($children as $child) { $articles = $child->children; foreach($articles as $article) { … } } i want all articles to be sorted by title (asc) i tried this: $articles = $child->children('sort=title'); but the sorting happened too early an this doesn't work also (too early) foreach($articles->sort('name') as $article)
-
thanks Macrura i did an now this. sorry, but i don't know where that should be This page contains the following errors:error on line 46 at column 106: Attribute alt redefined
-
i installed the module and used this in my template: $rss->title = "Latest updates"; $rss->description = "The most recent pages updated on my site"; $items = $pages->find("limit=10, sort=-modified"); $rss->render($items); now i'm getting an error for the last line: Error: Call to undefined method stdClass::render() (line 11 of /var/www/vhosts/***/httpdocs/tmp/site/templates/feed.php)
-
it works! $lang = $user->language->name; if($lang == 'default') { setlocale(LC_TIME, "de_DE.UTF8"); } else { setlocale(LC_TIME, "en_EN.UTF8"); } and utf8_encode(strftime('%A <br>%d %B %Y', $page->getUnformatted('postDate'))) THANKS!
- 7 replies
-
- 3
-
-
- date
- multilanguage
-
(and 1 more)
Tagged with:
-
UPDATE: i delted setlocale in config.php added it to the template-file now both languageversion are german is there a way to to setlocal as a variable?
- 7 replies
-
- date
- multilanguage
-
(and 1 more)
Tagged with:
-
@martijn yes, i added setlocale(LC_TIME, "de_DE.UTF8"); to the config.php
- 7 replies
-
- date
- multilanguage
-
(and 1 more)
Tagged with:
-
and i treid it with this in the template-file utf8_encode(strftime('%d. %B %Y', $page->getUnformatted('date'))); still everthing in english
- 7 replies
-
- date
- multilanguage
-
(and 1 more)
Tagged with:
-
thanks Jürgen. no luck. still in english i noticed that my html begins always like this: <html lang="en" … is that a problem?
- 7 replies
-
- date
- multilanguage
-
(and 1 more)
Tagged with:
-
i did a multilanguage-install. english and german are needed i set german as default (install german languagepack at default) then add english (en) as second language my date-output is custom: %A %d %B %Y (Details Tab) echo $page->date the problem is that i always get the english ouput.
- 7 replies
-
- date
- multilanguage
-
(and 1 more)
Tagged with:
-
@teppo thanks here the final code: <div class="pagination"> <?php $prevPage = $page->prev; $nextPage = $page->next; if($page != $pages->get(1019)->children->first()) { echo "<a class='link next' href='" . $prevPage->url . "' >"; foreach($prevPage->image as $image) { $thumb = $image->height(60); echo "<div><img src='" . $thumb->url . "'/></div>"; } echo "<span>". $prevPage->title ."</span>"; echo "<span class='date' >". $prevPage->teaser_date ."</span>"; echo "</a>"; } if($page != $pages->get(1019)->children->last()) { echo "<a class='link prev' href='" . $prevPage->url . "' >"; foreach($nextPage->image as $image) { $thumb = $image->height(60); echo "<div><img src='" . $thumb->url . "'/></div>"; } echo "<span>". $nextPage->title ."</span>"; echo "<span class='date' >". $nextPage->teaser_date ."</span>"; echo "</a>"; } ?> </div>
-
thanks Marttijn i edited the code but still getting Internal Error there are always at least 3 children of that page (1019). and all of them aren't hidden. <div class="pagination"> <?php $prevPage = $page->prev; $nextPage = $page->next; if($page != $pages->get(1019)->children->first()) { echo "<a class='link prev' href='" . $prevPage->url . "' >" foreach($prevPage->image as $image) { $thumb = $image->height(60); echo "<div><img src='" . $thumb->url . "'/></div>"; } echo "<span>". $prevPage->title ."</span>"; echo "<span class='date' >". $prevPage->teaser_date ."</span>"; echo "</a>" } if($page != $pages->get(1019)->children->last()) { echo "<a class='link next' href='" . $nextPage->url . "' >" foreach($nextPage->image as $image) { $thumb = $image->height(60); echo "<div><img src='" . $thumb->url . "'/></div>"; } echo "<span>". $nextPage->title ."</span>"; echo "<span class='date' >". $nextPage->teaser_date ."</span>"; echo "</a>" } ?> </div>
-
there is a pagination (next|prex) at the end of the page i want to hide next on the last page of the siblings and hide prev on the first <?php if($page != $pages->get(1019)->children->first()) { echo "<a class='link prev' href="$page->prev->url">"; foreach($page->prev->image as $image) { $thumb = $image->height(60); echo "<div><img src='$thumb->url'/></div>"; } $test = $page->prev; echo "<span> $test->title </span>"; echo "<span class='date' > $test->teaser_date </span>"; } echo '</a>' if($page != $pages->get(1019)->children->last()) { echo "<a class='link next' href="$page->next->url">"; foreach($page->next->image as $image) { $thumb = $image->height(60); echo "<div><img src='$thumb->url'/></div>"; } $test = $page->next; echo "<span> $test->title </span>"; echo "<span class='date' > $test->teaser_date </span>"; } echo "</a>"; ?> line 3: echo "<a class='link prev' href="$page->prev->url">"; is causing the error but i don't know why
-
i changed the order and it worked if($box->text) { //text } else { //images } would be nice to know why it doesn't work the other way around
-
thanks but it doesn't work i still get this <div class="box images" >…</div> <div class="box images" >…</div> <div class="box images" >…</div> <!-- this one below ist the repeater without images --> <div class="box images" ></div>
-
i have a repeater with 2 fields – image – text if there are images uploaded then the output should be only the image field. if no images uploaded, then only the text-field should be shown right now, if the image-field is empty and the text-field is filled. i'm getting two boxes. and the first one is empty. <?php foreach($page->repeater as $box) { if($box->images) { ?> <div class="box images"> <?php foreach($box->images as $image) { echo "<img src='$image->url'/>"; } ?> </div> <?php } else { } if($box->text) { ?> <div class="box text"><?php echo $box->text; ?></div> <?php } } ?>
-
i've the same problem with 1und1 my password is just text without ' or " any ideas?
-
how to find pages with a certain page-field-option selected
ngrmm replied to ngrmm's topic in Getting Started
thanks! -
pages with the same template have a page-field. i can select multiple pages and they are like tags i output them like this <?php foreach($page->tag as $tags) { echo "<a href='$tags->url'>{$tags->title}</a>"; } ?> the tag-pages ($tags->url) should just show the pages with the certain tag selected. is there a way to filter? where in the documentation do i find something about this.
-
i am using CKEditor and want the design to be like the image below is there a way to get rid auf the <p>-tag around ther inserted image and also keep the <p>-tag around the text? <p>text</p> <p><img></p> <p>text</p> to <p></p> <img> <p></p>