Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by rareyush

  1. $rating = $item->rating; for ($i = 1; $i <= $rating; $i++) { if ($i <= $page->rating) { $rate = "<span class='fa fa-star star selected '> </span>"; } else { $rate = "<span class='fa fa-star'> </span>"; } } I am using this and and I can see only 1 star everywhere, where i am wrong???
  2. solved it i was calling using get function to call page body. it's fixed now
  3. I am using new processwire and I am receiving this error in my _func.php Parse Error: syntax error, unexpected 'return' (T_RETURN) Parse Error: syntax error, unexpected '$out' processwire anyone knows anything ??
  4. I moved my site to Google cloud platform and i am stuck some where. my homepage is working fine but when it comes to other pages it says 404 not found and when i add this on virtual host <Directory "/var/www"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> or <Directory "/var/www"> AllowOverride All </Directory> I receive internal server error I tried comment out this line to but still same thing # RewriteBase / and # RewriteRule ^(.*)$ /index.php?it=$1 [L,QSA]
  5. solved guys did some mistake in _main.php file
  6. I am using this function to get blogpost but I don't see what's wrong in it and why it is now showing anything in frontend. function ukBlogPost(Page $page, $options = array()) { $defaults = array( 'summarize' => null, // Display blog post summary rather than full post? (null=auto-detect) 'metaIcon' => 'info', 'moreIcon' => 'arrow-right', 'moreText' => __('Read more'), 'categoryIcon' => 'hashtag', 'bylineText' => __('Posted by %1$s on %2$s'), ); $options = _ukMergeOptions($defaults, $options); $title = $page->title; $img = $page->images->first(); $date = $page->date ? $page->date : $page->createdStr; $name = $page->createdUser->name; $body = summarizeText($page->get('body'), 100); $metaIcon = ukIcon($options['metaIcon']); $moreIcon = ukIcon($options['moreIcon']); $categoryIcon = ukIcon($options['categoryIcon']); $n = $page->comments->count(); $numComments = $n ? "<a href='$page->url#comments'>" . ukIcon('comments') . " $n</a>" : ""; $itn = $page->get('itineraries'); $ito = $itn->each( "<h4> {itineraries_title}</h4> <p>{itineraries_details} </p> "); if($options['summarize'] === null) { // auto-detect: summarize if current page is not the same as the blog post $options['summarize'] = page()->id != $page->id; } /* $categories = $page->categories->each($categoryIcon . "<a class='uk-button uk-button-text' href='{url}'>{title}</a> " );*/ if($options['summarize']) { // link to post in title, and use just the first paragraph in teaser mode $title = "<a href='$page->url'>$title</a>"; $body = explode('</p>', $body); $body = reset($body) . ' '; $body .= "<a href='$page->url'>$options[moreText] $moreIcon</a></p>"; $class = 'blog-post-summary'; } else { $class = 'blog-post-full'; } if($options['summarize']) { $heading = "<h4 class='uk-margin-remove tour-heading'>$title</h4>"; } else { $heading = "<h3 class='uk-article-title uk-margin-remove tour-heading'>$title</h3>"; } $byline = sprintf($options['bylineText'], $name, $date); if($img) { $img = $img->size(375,380); } // return the blog post article markup return " <div> <div class='uk-card'> <div class='uk-inline-clip uk-transition-toggle'> <img src='$img->url' alt='$img->description' class='uk-border-rounded uk-transition-scale-up uk-transition-opaque' > <div class='uk-overlay uk-light uk-position-bottom'> <p class='uk-text-light'>$heading</p> </div> </div> $ito </div> </div> "; } I tried running $title, $img etc. - or are they all blank? simultaneously but nothing returns anything. I do not know why it is not working
  7. Exactly this is what I was looking for Thanks @Christophe
  8. text field won't work here because when user select create new I want to show 2 text fields there.
  9. I have only one page using " contact -form " template & I want all information there only from both contact forms.
  10. I am trying too create a custom field where when user select to create a category 2 text area shows where one title of the category goes & another for some content. Like in a picture I want 2 text areas when I click on create new
  11. There is not error, as I mentioned I created contact form template where I save contact info like this in a page but when I created another contact page template I was getting error thanks to you error is gone but I am getting contact information saved in this page "contact".
  12. $form->parent = $page->get('template=contact-form')->id; // optional, saves form as page it does only one thing, it stops showing error but I am getting error in admin panel where I used this template "contact-form".
  13. I created a template where I am rendering this php file where I am saving contact quires in a template and it is working fine in homepage. I used my same code in another page on a same project by creating another template and rendering another file but I am receiving this error again and again, I tried to figure out but it not working. <?php namespace ProcessWire; $form = $modules->get('FormTemplateProcessor');$form->template = $templates->get('contact'); // required $form->requiredFields = array('title', 'fullname','email_form', 'mobile', 'message'); //$form->email = 'your@email.com'; // optional, sends form as email $form->parent = $page('template=contact-form'); // optional, saves form as page $form->render(); // draw form or process submitted form ?> <?php echo $form->render(); ?> error I am receiving anyone can any solutions for it ?
  14. Thanks kixe Love you a lot, you solved my big problem, I was trying to add that code in my main file & in init file. Thanks a lot
  15. from admin panel I created new field whose type I choose 'file'. i have a template for contact form where i want to put this field and give access to upload files options to users but when i add this new field in that template my site stops working, i saw that error which i posted above everywhere.
  16. I am trying to add a file type field in a template but when I give access to the template I receive this error Error: Exception: New page '//' must be saved before files can be accessed from it (in /mysite/wire/core/PagefilesManager.php line 342) #0 /mysite/wire/core/PagefilesManager.php(328): ProcessWire\PagefilesManager->___path() #1 /mysite/wire/core/PagefilesManager.php(268): ProcessWire\PagefilesManager->path() #2 /mysite/wire/core/PagefilesManager.php(106): ProcessWire\PagefilesManager->createPath() #3 /mysite/wire/core/PagefilesManager.php(90): ProcessWire\PagefilesManager->init(Object(ProcessWire\Page)) #4 /mysite/wire/core/Page.php(3498): ProcessWire\PagefilesManager->__construct(Object(ProcessWire\Page)) #5 /mysite/wire/core/Pagefiles.php(132): ProcessWire\Page->filesManager() #6 /hom This error message was shown because: you are logged in as a Superuser. Error has been logged.
  17. my seniors told me that jquery is blocked in some browsers that's why try not use too much of jqueries but I am using loop and all the childrens are coming from a loop and i want full width menu on 3rd menu only not others, because 3rd menu is the only menu who has many submenus Thank you I'm reading
  18. hi everyone I am trying get a full width sub-menu on 3rd item in menu or navbar which is coming from a loop. i was hoping this can be done by using jquery by targeting 3rd element in navbar but jquery is blocked in some browser by default so is there any other method I can do this
  19. This worked for me, Thank you I really appreciate and this is why I love processwire more now xD
  20. I'm trying to display body part but as a summary which doesn't include any image. I was able to get limit the words by using this function <?PHP function truncateWords($input, $numwords, $padding="") { $output = strtok($input, " \n"); while(--$numwords > 0) $output .= " " . strtok(" \n"); if($output != $input) $output .= $padding; return $output; } ?> but if there is an image it show that image as well. any api or anything which I can use to use show just limited text ?????
  • Create New...