Jump to content

Roych

Members
  • Posts

    383
  • Joined

  • Last visited

Everything posted by Roych

  1. Hello, I need some help as I'm not a coder. I've created a slider from repeater which is working great. I need to make some slides with a link so I have created a "Link" field (also working) but now all my slides have links. The one with the new link is linking right but all others link to root. Basicaly what I need is if field is empty show this else this. ..;) I've tried with this: <?php if($page->Slides->Link): ?> <?php foreach($page->Slides as $Slides): ?> <?php // get the very first image from images list since image field is accepting multiple images (unless you change the value of `Maximum files allowed` under Fields > images > Details tab > Maximum files allowed). $image = $Slides->images->first(); ?> <li data-transition="<?php echo $page->Slide_Effect; ?>" data-slotamount="7" data-link="<?=$Slides->Link ?>" data-target="_blank" > <img src="<?php echo $image->url; ?>" alt="<?php echo $image->description; ?>"> <div class="tp-caption" data-x="100" data-y="115" data-speed="700" data-start="1000" data-easing="easeOutBack"><h2><?=$Slides->title ?></h2></div> </li> <?php endforeach; ?> <?php else: ?> <?php foreach($page->Slides as $Slides): ?> <?php // get the very first image from images list since image field is accepting multiple images (unless you change the value of `Maximum files allowed` under Fields > images > Details tab > Maximum files allowed). $image = $Slides->images->first(); ?> <li data-transition="<?php echo $page->Slide_Effect; ?>" data-slotamount="7" > <img src="<?php echo $image->url; ?>" alt="<?php echo $image->description; ?>"> <div class="tp-caption" data-x="100" data-y="115" data-speed="700" data-start="1000" data-easing="easeOutBack"><h2><?=$Slides->title ?></h2></div> </li> <?php endforeach; ?> <?php endif; ?> Not really working. Any help is appreciated. R
  2. Yes, exactly what I need It's working perfectly Thank you for the code, very useful. I was trying to do something like this but not realy good with PHP. R
  3. this should be the same as in the first code, I forgot to change it back as I was playing and trying all sorts of things. As I said I'm not a coder so I'm playing around, sorry for that So the first code is the one I'm using to show the events and all is working. All I need is to show the text if there is no upcoming events. Not sure how to put arjen's code together. thx R
  4. Hmm... I was to fast it's not working :/ I'm doing something wrong ... My whole original code looks like this: <?php foreach ( $pages->find('template=calendar-post, limit=8, Start_date>=today, sort=Start_date') as $single ):?> <!-- Event --> <li> <div class="date"> <span> <span class="day"><?php echo strftime("%d", strtotime($single->Start_date)); ?></span> <span class="month"><?php echo strftime("%h", strtotime($single->Start_date)); ?></span> <span class="year"><?php echo strftime("%Y", strtotime($single->Start_date)); ?></span> </span> </div> <div class="event-content"> <h6><a href="<?=$single->url?>"><?=$single->title?></a></h6> <ul class="event-meta"> <li><i class="fa fa-clock-o">&nbsp;&nbsp;</i> <?php echo strftime("%H:%M", strtotime($single->Start_date)); ?><sup><?= $out = __("h"); ?></sup></li> <li><i class="icons icon-location"></i> 340 W 50th St.New York</li> </ul> </div> </li> <!-- /Event --> <? endforeach; ?> I tried to work with your code but I'm doing it totaly wrong I guess :/ <?= $events = $pages->find('template=calendar-post, limit=8, Start_date>=today, sort=Start_date'); if (count($events)) { echo '<li>', '<div class="date">', '<span>', '<span class="day">{echo strftime("%d", strtotime($single->Start_date))}</span>', '<span class="month">{ echo strftime("%h", strtotime($single->Start_date))}</span>', '<span class="year">{ echo strftime("%Y", strtotime($single->Start_date))}</span>', '</span>', '</div>', '<div class="event-content">', '<h6><a href="<?=$single->url?>"><?=$single->title?></a></h6>', '<ul class="event-meta">', '<li><i class="fa fa-clock-o"> </i> <?php echo strftime("%H:%M", strtotime($single->Start_date)); ?><sup><?= $out = __("h"); ?></sup></li>', '<li><i class="icons icon-location"></i> 340 W 50th St.New York</li>', '</ul>', '</div>', '</li>'; } else { echo "<span style='font-size:12px;text-align:center;'>No upcoming events at this time!</span> "; } ?> If I just paste your empty code in I get Id's of articles like 1106|1107|1108 ... Thank you R
  5. It works, but if there is an upcoming event, it also shows me the id number of an event how do I get rid of it. And for multilanguage site I tried <?= $out = __('No events at this time.'); ?> but it's not working. (not that important atm) Thank you R
  6. Hello, The upper works like a charm but was wondering if it is somehow possible to add some text if there is no upcoming events. like (There is no upcoming events ...) So maybe some if else statements or something, I'm not a coder, but understand a little. I'm using Start_date>=today option from upper posts to show upcoming events. <?php foreach ( $pages->find('template=calendar-post, limit=8, sort=Start_date') as $single ):?> Thank you R
  7. Hello, any update on this or some new modules maybe. I tried this couple of times but somehow can't get this to work at all.. I'm new to PW but I think that there should be some module for this would be much easier for beginners ike me. I need this so that my "client" should see the clicks and other info like mr-fan image here Any help is appreciated Thank you. R
  8. Good to know, thank you R
  9. Oh, that easy, hehe. Works great Thank you very much, was struggling with that for some time before I decided to ask here. R
  10. Hello all I'm creating some simple events where every child is a new event. I have start date, content and image field assignet to them. Now I would ilke to show only an upcoming events. Only events that are still to come, so that events older than the (start date) are not shown. I tried to work with THIS but no luck as Im not a coder. Im showing all events like this now: <?php foreach ( $pages->find('template=calendar-post, limit=8, sort=Start_date') as $single ):?> <div class="calendar-block"> <a href="<?=$single->url?>"><h6 style="font-size: 14px;font-weight: 400;"> <img height="180" src="<?=$single->Slikces->first->url ?>" alt="<?= $single->Slikces->description->first ?>" style="margin-right: 10px; float: left; object-fit: cover;" width="220px"> <div class="naslovv"><b><?=$single->title?></b></div></h6> </a> <div class="ura-datum"> <span class="ime-dneva"><?php echo strftime("%A", strtotime($single->Start_date)); ?></span> | <i class="fa fa-calendar" aria-hidden="true"></i>&nbsp;&nbsp; <?php echo strftime("%d %B", strtotime($single->Start_date)); ?> <?php echo strftime("%Y", strtotime($single->Start_date)); ?> | <i class="fa fa-clock-o">&nbsp;&nbsp;</i> <?php echo strftime("%H:%M", strtotime($single->Start_date)); ?><sup>h</sup> </div> <div style="text-align:justify; color:inherit;padding-top:10px;padding-right:10px;"><?=$single->Content?></div><a href="<?= $single->url ?>" class="button read-more-button big button-arrow"><?= $out = __("Read more"); ?></a> </div> <? endforeach; ?> I'd like to show upcoming events on another template (homepage) as well. Any help greatly appreciated Thank you in advance R
  11. Woow, that was fast and works perfect. Very helpfull also, thank you R
  12. Hello, Im having some trouble hiding a <p> in my template if a checkbox is "checked". I have two fields "text field for a button" and "simple checkbox for hidding a text button field" with a dependency to hide button field if hecked. Now I need to hide that button in frontend if checked. It is a list of pages "blog like" with a read more button. Sometimes that button is not nessasary so I need an option to hide it on some articles. I tried with: (RemoveButton = Checkbox field - Text = Button text field) <?php if (strlen(trim($single->RemoveButton)) > 1): ?> <p><a button href="<?= $single->url ?>" type="submit" id="submit" class="btn btn-blue btn-effect"><?=$single->Text?></button></a></p> <?php endif; ?> I need to hide all that <p> somehow. Hope I wrote understandable. R
  13. Ok, I installed " MediaLibrary " Plugin and problem is solved I just have to upload images first in library and then I can select them in CKEditor R
  14. Hey I'm back here. I just noticed, that Now I can not upload new images into the ckeditor at all. I need to separate the image field and the Ckeditor somehow. I didn't expect this from PW at all. Very annoying actually. Thank you R
  15. Hello, I'm new to PW! I'm having some problems with images in PW. I have two fields, CKeditor and Images field. The problem is when I upload images in CkEditor the images are also shown under the images fields, how can I get ridd of that. I have images field for separate images gallery in every post, below the text. So again if I ad image betwen text it is also shown in a gallery below. I don't need this. Hope u understand Thank you R
  16. Hello I need to put in google-site-verification meta tag in my head but it leaves me (show on frontend) the closing tag " /> should I put this in SEO module somewhere or. My meta looks like this. <meta name="google-site-verification" content="<meta name="google-site-verification" content="WIERD-GOOGLE-NUMBER" />" /> How can I do this right, thank you R Ignore, It was wrong copy paste and pressure from a client, lol Fixed!! R
  17. Sorry for not being clear enough. I would like to style my form created in SimpleContactForm module. But I can't figure it out how from those instructions. Where and how should I change classes in my code. expl. My code for showing a form now, looks like this. <?php echo $modules->get('SimpleContactForm')->render(); ?> this is giving me some basic style from PW. How do I change those styles so it would look like the form posted in first post? I tried and played with this $scf = $modules->get('SimpleContactForm'); $options = array( 'markup' => array( 'list' => "<div {attrs}>{out}</div>", 'item' => "<p {attrs}>{out}</p>" ), 'classes' => array( 'form' => 'form form__whatever', 'list' => 'list-item' ) ); echo $scf->render($options); but can't figure it out how this should work. There is no changes no mather what I do ... And where is the Style for submit button etc.? I hope I was more clear this time. Thank you R
  18. Hello, Im having some problems with simple contact form styling. I tried everything but just don't get it. I went throu THIS pages but can't figure it out what should I actually do to make it the way I want. I tried and played with this but no success. Im not a coder but understand some ... My HTML looks like this: <form action="#" method="post"> <div class="input-field"> <input type="text" name="name" class="form-control" placeholder="Your Name..."> </div> <div class="input-field"> <input type="email" name="email" class="form-control" placeholder="Your Email..."> </div> <div class="input-field"> <input type="text" name="Phone" class="form-control" placeholder="Phone Number..."> </div> <div class="input-field"> <textarea name="message" class="form-control" placeholder="Messages..."></textarea> </div> <button type="submit" id="submit" class="btn btn-blue btn-effect">Send</button> </form> Any help is appreciated. Thank you R
  19. Works great, only sorting is wrong, it won't show last three. Thank you R
  20. The upper didn't quite work for me was a good starting point found this and it works great but how do I limit it to only 3 last events. <?php $Events = $pages->get('/Events/')->Events_repeat->getArray(); foreach ($Events as $key => $events) { ?> <div class="col-md-4 wow animated bounceInRight"> <div class="hovereffect"> <img src="<?=$events->Event_slika->first->url ?>" width="100%" class="img-responsive" style="border: 9px solid white;"> <div class="overlay"> <h2><?=$events->Event_slika->first->description ?></h2> </div> </div> </div> <?php if ($key == 2) { break;} }; ?> Thank you R
  21. Hello, I'm new to PW and like it already I have just created my first site with PW and need some help getting repeater posts from one page to expl. home page. I have a page called Events with template events.php . Page has a repeater field called Events_repeat. Now I would like to show last three events on a homepage, how do I do that. I have tried with: <?php foreach ( $pages->find('template=events, limit=3') as $event ):?> <div class="hovereffect"> <img src="<?=$event->images->first->url ?>" width="100%" class="img-responsive" style="border: 9px solid white;"> <div class="overlay"> <h2><?= $event->images->description->first ?></h2> </div> </div> <? endforeach; ?> But it doesn't work, what am I doing wrong. I tried to look on a forum but couldn't find anything helpful really. Thank you very much R
×
×
  • Create New...