Jump to content

jds43

Members
  • Posts

    96
  • Joined

  • Last visited

Profile Information

  • Location
    Arkansas

Recent Profile Visitors

3,482 profile views

jds43's Achievements

Full Member

Full Member (4/6)

17

Reputation

1

Community Answers

  1. Hello, I think this did the trick: if(wire('input')->pageNum > 1) $page_url = wire('page')->url . wire('config')->pageNumUrlPrefix . wire('input')->pageNum; Based on
  2. I have a large selection of location cards rendered by a function in _func.php, successfully paginated to 12. Within the cards, I'm using an onclick event in JS to perform an async request utilizing the url of a link referenced as a property ($page_url = $page->url) of the function. It only works on the first page. After that, the async function doesn't work properly because the url of the link in the card is localhost:8888/results/?add=2353 instead of localhost:8888/results/page2/?add=2353.
  3. Hello, I'm needing to whitelist a paginated link (href='{$page_url}?remove=$item->id') within _func.php. Does anyone have some information for this?
  4. This will activate Spanish by template: if($page->activate_spanish == 1) { $imported_producers = wire('pages')->find('template=producer'); foreach ($imported_producers as $p) { foreach (wire('languages') as $lang) { if ($lang->isDefault()) continue; $p->of(false); $p->set("status{$lang->id}", 1); $p->save(); } } }
  5. I see that activating languages for this child template works for populating the cards, but I'll be deleting and re-importing a sizable list every few weeks and will need a way to activate the Spanish name for all. Should I not use the Import Pages by CSV module and opt for another solution?
  6. Hello, I have a multi-lang template (English and Spanish) where title, summary and body are translated. This template has many children in default (English) language and I need to output fields from these as cards on the Spanish page. Is this even possible?
  7. Hello, how would I write a condition to output markup only to pages that have a template with multi-language support? I'm not finding any references to this particular topic.
  8. Ended up removing the searched user zip code from the $selector response and opted not to paginate. Hopefully it's good enough. $target = $pages->find("ZIP=$city_or_zipcode, template=producer"); $range = $find_help->children("ZIP=$selector"); $producers = $target->add($range->find("limit=24"));
  9. Hello, I'm using an API to return a collection of zip codes within a radius of a particular zip code the user will input. These will populate a list of locations, but I'm having trouble promoting the zip code input by the user to the top of the list. Sort isn't working at all. ZIP is the location page zip code field. $city_or_zipcode is the sanitized input. $selector is the decoded JSON response as string for zip codes separated by pipes. $producers = $locations->children("(ZIP=$city_or_zipcode), (ZIP=$selector), template=producer, limit=24"); I've even prepended the searched user zip code to $selector and it doesn't help either. Any ideas?
  10. Thanks @kongondo for taking the time to prepare all of this!
  11. So, I have htmx working, but it's replacing the deleted card with the whole page. Odd, but I probably have some settings wrong: $out .= "<div hx-post='./' hx-vals='#card-$item_id' hx-target hx-ext='ajax-header' class='".(($row) ? 'uk-width-1-3' : 'uk-width-expand')."'> <div class='image uk-card-media-top uk-background-cover uk-position-relative ".(($row) ? 'rad' : 'rounded-top-left-right')."' $img data-uk-img> <span class='uk-position-top-right uk-position-small uk-preserve' data-uk-icon='icon: heart; ratio: 2'></span> </div> </div>";
  12. Hello @kongondo, could you provide the full code? I'd like to try applying it to my project. Thank you!
  13. Thanks @Rudy and @Pixrael! I wasn't aware urlSegment would not capture URL query strings. I went this route: if(!isset($_GET['publish_from']) || !isset($_GET['publish_until'])) { // output only on /events/ }
  14. Hello, I would like to output content on a template at the url /events/, but not /events/?publish_from=2021-08-24&publish_until=2021-08-31. Tried using the wildcard character as referenced here, but no dice. Does anyone know to achieve this? $segmented_events = $input->urlSegment('publish_(*)'); if(!$segmented_events) { // output only on /events/ }
×
×
  • Create New...