Jump to content

Marcel Epp

  • Posts

  • Joined

  • Last visited

About Marcel Epp

  • Birthday 02/01/1982

Profile Information

  • Gender
  • Location

Recent Profile Visitors

1,749 profile views

Marcel Epp's Achievements

Full Member

Full Member (4/6)




Community Answers

  1. OK it is working now. For the overview page i used: <p class="text-center">veröffentlicht am <?= $blog_post->page_published ?></p> And for my single blog page i used: <p class="text-center">veröffentlicht am <?= $page->page_published ?></p> So creating an extra field and put this in the single blog file is like a workaround.
  2. One solution i thought of is to create a new datetime field like "page_published". And when you create a new page the field get filled with the current date. But i can't output the field like the others. I build myself a little blog. <!-- the logic --> <?php $blog_posts = $pages->find('template=blog-single, limit=1, sort=-created'); ?> <?php foreach($blog_posts as $blog_post): ?> <?php $blog_post_publish_date = date('d.m.Y', $blog_post->published); $blog_post_created_by = $blog_post->createdUser->name; ?> But when i change $blog_post->published to $blog_post->page_published i get an empty result. This is from the overview site from the blog.
  3. Hi Zeka, that solves the problem for the user. Tahnk you! But the second problem still persist. How can i change the published date in the admin area?
  4. Hi, i'm stuck here with a problem. I want to change the user that created a site. And i want to change the published date time. But i can't find an option in the admin area. Does Processwire have these options? Or is there a modul for that? thanks
  5. Yeah! awesome the active part makes it even better. 'currentItemClass' => "active"
  6. Hi Jonathan, thank you for your answer. That solved the problem! The code looks now like this: echo $images_posts->renderPager(array( 'nextItemLabel' => "Vorwärts", 'previousItemLabel' => "Zurück", 'listMarkup' => "<nav aria-label='Page navigation'><ul class='MarkupPagerNav pagination'>{out}</ul></nav>", 'itemMarkup' => "<li class='{class} page-item'>{out}</li>", 'linkMarkup' => "<a class='page-link' href='{url}'>{out}</a>", 'currentLinkMarkup' => "<a class='page-link' href='{url}'>{out}</a>" ));
  7. Hi, i am trying out Bootstrap 4. I want to build a site for my wife. Thanks to the forum i get the blog part done. But the pagination is not working as aspected. The first number of the pagination did not get styled. Only for the first and the last link there is a span and no class is asigned. echo $images_posts->renderPager(array( 'nextItemLabel' => "Vorwärts", 'previousItemLabel' => "Zurück", 'listMarkup' => "<nav aria-label='Page navigation'><ul class='MarkupPagerNav pagination'>{out}</ul></nav>", 'itemMarkup' => "<li class='{class} page-item'>{out}</li>", 'linkMarkup' => "<a class='page-link' href='{url}'>{out}</a>" )); result is: The markup from the first picture is not the same like the other. How can i change the markup for the first link, and the last link of course when i changed the site?
  8. I have searched for a solution. I would shorten the text from my blog entries. This seems to work for me. It keeps the html tags from the editor: function truncateHtml($text, $length = 100) { $current_size = strlen($text); $diff = strlen($text); $remainder = $current_size - $length; while($diff > 0 AND $remainder > 0) { $pattern = "/(.*)[^<>](?=<)/s"; $text = preg_replace($pattern, "$1", $text); $diff = $current_size - strlen($text); $current_size = strlen($text); $remainder = $current_size - $length; } // iff $diff == 0 there are no more characters to remove // iff $remainder == 0 there should removed no more characters return $text; } It's from here: https://stackoverflow.com/questions/38548358/cut-html-input-while-preserving-tags-with-php Post Number 4.
  9. Hi abdus, thank you very much! the category=$page think was the missing piece! Now my category pages list the blog posts that assigned to that category. I have to tweak it for me cause my field has another name: <?php $blog_category = $pages->find("template=blog-entries, categories=$page"); foreach ($blog_category as $category) { echo "<a href='{$category->url}'>{$category->title}</a> "; } ?>
  10. Hi, i'm trying to build a simple blog. Thanks to this forum it is working good. But i ran into a problem. How can i match my categories with the title? When i visit the page "Buchbinder" it should show me all pages that tagged with the category "Buchbinder" under "Neuigkeiten". How can i do that? My category page now looks like this: $blog_category = $pages->find("template=blog-entries"); foreach ($blog_category as $category) { echo "<a href='{$category->url}'>{$category->title}</a> "; } But how can i now say match the title from this site? thanks Marcel
  11. I think there is a missing ' <div<?php echo " style='background-image: url(" . $topleft->url . ")'; " ?>>
  12. Thanks dragan! and thanks maxf5 you really helped me out! It is working now. I think i mixed your last entries. The code i use now: // find the highest customer number $highest_customer_number = $pages->get("template=user, sort=-id, limit=1, roles=anzeigen-anbieter")->customer_number; // add +1 $customer_number_plus_one = $highest_customer_number + 1; //create user details $user = new User(); $user->of(false); $user->pass = rand_string(8); $user->email = $email; $user->customer_number = $customer_number_plus_one; $user->addRole("anzeigen-anbieter"); $user->save(); $user->of(true);
  13. Hi Rick, at the moment i didn't save the number. My first thought was to get the field (customer_number) and the latest number and echo that out. I would see if this would work. But for me it's not really clear how to get the number. I tried dragans way and my own.
  14. Or can i query the database direct? to get the latest number from the field?
  • Create New...