Jump to content

Roych

Members
  • Posts

    383
  • Joined

  • Last visited

Everything posted by Roych

  1. Hello, I need some help with somethin Im working on. I want to show different design if the current page doesn't have siblings or children. I'm using basic-page template for all my articles (siblings, children and normal pages all with the same fields) and Im showing sidebar with siblings or children on all of them. But when the page doesn't have any of them I want it to be without the sidebar. I tried with: <?php namespace ProcessWire;?> <?php $nosidebar = $page->hasChildren() ;?> CODE WITH SIDEBAR <?php elseif ($page->siblings()) :?> CODE WITH SIDEBAR <?php elseif (!$nosidebar) :?> CODE WITHOUT SIDEBAR <?php endif ;?> It kinda works as it should but it shows shows me the sidebar on a page without children or siblings. Tried everything and got kind a lost here. Not even sure if this is the right way to do this. Any help greatly appreciated. Thank you R
  2. Yeees, it's working perfect now. I need to bookmark this. ? Thank you many, many times for help ? R
  3. Yes this actualy work as expected, just not sure how to create a link (url) to a gallery. I just had to change $page to $single in your code. I guess something like: <a href="<?=$single->url?>">View Gallery</a> but ofc not working it links to event not gallery. Thank you R
  4. yes I did, still, every event has entire list of events listed under them.
  5. Already tried that, this gives me the entire list of all events in every past event on the list. So I get Event 1 - event1, event2, event3, etc ... Event 2 - event1, event2, event3, etc ... Event 3 - event1, event2, event3, etc ...
  6. thank you ?, but this is not working still shows the entire list of all galleries pages. The link should be connected to a gallery page. I want to show "View Galery" button only on, and for selected event. If past event is selected when creating a new gallery (with page reference field) if not, nothing is shown on the event list, because some galleries doesn't belong to events at all.) Event list should look like: (template = "past-events") Past event 1 Past event 2 ("View Gallery" -> event was selected in gallery page ) Past event 3 Past event 4 Past event 5 ("View Gallery" -> event was selected in gallery page) etc ... Thank you R
  7. Hello, I went throughout the forum but nothing similar came up. I need some help with showing selected page reference (page selection) on another page and link to it. I tried al sorts of things and got lost. I have pages like: - Past Events list - (template = "past-events") - Image Gallery - (template = "gallery-album" with page reference field, named "select_event_gallery") Because galleries are added later for each past event, I created a page reference field on gallery page, where you can select the past event to which this gallery should belong to. Then the link (simple button "View Gallery") to this gallery would then be shown on a past event list for a specific selected event. I hope you understand ? I tried with: (shows all galleries and not sure what the url should look like) <?php $galeries = $pages->find("template=gallery-album"); ?> <?php foreach ($galeries as $galery) :?> <a href="<?=$galery->LINK TO GALLERY?>">View Gallery</a> <?php endforeach;?> Ofc. not working. I'm not sure how to approach this so any help is appreciated Thank you R
  8. Yes, very helpful. ? This should be in the core. R
  9. Wow, thank you for this. Looks and works great. ? Some of my clients are more familiar with stacked items than list. Especialy if they have lots of items added. Thank you very much R
  10. Selection of default compact view possible somehow? Thank you R
  11. Yes for styling, it needs span for the effect to work corectly. I've tried with { name: 'BUTTON', element: 'div', attributes: { 'class': 'theme-btn btn-style-one style-two newclass' } }, and $('.newclass a').wrapInner('<span/>'); which kinda works, <div class="theme-btn btn-style-one style-two newclass"><a href="#"><span>All products</span></a></div> but because all is now in a div i have to figure it out how to align the button when clicked on (align-left, right, centered) in ckeditor. any better idea maybe? R
  12. Hello, one question I'm having hard time to get this to work correctly, not even sure if it can be done like this. I have some custom styles in mystyles.js in ckeditor. All works great except one button. I need: <a href="#" class="theme-btn btn-style-one style-two"><span>View products</span></a> I tried: { name: 'BUTTON', element: 'span', attributes: { 'class': 'theme-btn read-more' } }, but this gives me: <span class="theme-btn btn-style-one style-two"><a href="#">All products</a></span> Any ideas how to achieve this? Thank you R
  13. Yes, that did the trick. Was looking everywhere for something like this. Thank you a million ? R
  14. Yes I need to remove only the surrounding <p> tags for this one textField only, because it messes my front end look. I'm not a coder, so not really sure how to proceed here. Thank you very much R
  15. Hello, I know this was probably asked a million times before but I tried all kinds of "solutions found on forum" none of them works for me. I need CkEditor but I don't want my content wraping in <p>. How can I get rid of them but keep other formating. Just get rid of first and last <p> and </p>. I tried (works for others based on forum threads ...) <?php $bodyCopy = preg_replace('/<p>\x{00A0}<\/p>/u', '', $pages->get("/nastavitve/")->kontaktni_podatki); echo $bodyCopy; ?> But it's not working. It still leaves the wraping <p> tags. Thank you R
  16. Thank you, it's working now. As you'we stated above, showing two when logged in. ? R
  17. Hello Not sure why but it always shows me two qrcodes (images -> gif) next to each other on the page. Can't see the problem in my code. Any ideas? I have a select-options field with option to show the qr-code or not. If selected It always shows two qr-codes. This happened after the upgrade of the module actualy it was working fine before!! My code <?php if ($item->id == '3') : ?> <div class="qrkoda"><?=$page->qr_koda?></div> <?php else:?><?php endif;?> Thank you R
  18. Oh great, I thought so, just had to make sure I'm not missing this out. ? Thank you very much. R
  19. Hello, Am I missing something or .. I guess there is no Padlooper.zip file to download yet, or ...? Just seeing all comments about excitement but I can't see any links to download here. Thank you R
  20. I repaired a table for body field through PHPMyadmin and it is fixed now. R
  21. Hello, Im having troubles with this error, any ideas how to fix this? It happens everytime I want to change something in body field. It was working fine till today? SQLSTATE[HY000]: General error: 126 Incorrect key file for table './mydb_name/field_body.MYI'; try to repair itIn /wire/core/Fieldtype.php line 1333 Not sure if this is PW related or server maybe? Thank you R
  22. I only used "substr($title, 5)" string and works just fine. ? Thank you R
  23. Uff, that simple ? I was overthinking everything. ? Thank you very much ? R
  24. Hello I'm trying to remove first four characters from a title field (or custom text field), how would I do this? I have titles like (they are imported with csv and numbers are for automatic categorising sort so they have to be there) 01 - Category1 02 - Category2 03 - Category3 I only want to output the Category1, category2, etc... Any help appreciated Thank you R
×
×
  • Create New...