-
Posts
812 -
Joined
-
Last visited
Everything posted by a-ok
-
Thanks adrian. Do you happen to know if this works in 3+? I have the following in ready.php which seems to re-route the URLs but page itself states 404? <?php wire()->addHookBefore('Page::path', function($event) { $page = $event->object; if ($page->template == 'article-detail') { $event->replace = true; $event->return = "/$page->name/"; } });
-
I have a list of articles, all under the parent 'Articles', however I would like the URL for each to be, for example, www.website.com/this-is-an-article rather than www.website.com/articles/this-is-an-article. Any ideas if this is possible?
-
I'm using the Eventbrite API to output events but ideally I'd like to create and update pages for each event (so each event on Eventbrite has a page on PW); these should be read-only so only data is taken from EB and not editable on PW. I reckon it'll be fairly easy to create the pages... I guess it's the checking 1) if the page already exists and 2) if any content has changed. This is a job on offer and would like some idea of cost and if it's possible.
-
Any further thoughts on this? Essentially I was thinking about using Eventbrite API and hooking it into PW.
- 5 replies
-
- events
- management
-
(and 1 more)
Tagged with:
-
Thanks, adrian. There's an RSS feed on a site that we want to loop into and display on another site. I have access to the site with the RSS (which uses PW) and have set up a /rss/ page that includes the image BUT using MarkupLoadRSS on the site I want to display... you can echo out title, date etc... but don't think you can echo out the enclosure tag (<enclosure url="http://website.com/site/assets/files/1535/jc_image.400x300.jpg" length="28983" type="image/jpeg"/>). Personally I never wanted to use RSS but there's a few other sites we're taping into too that we can only use RSS.
-
Thanks. I'm guessing you then can't use MarkupLoadRSS to get the image field now that it's in the feed?
-
Is it possible to include images in an RSS feed using http://modules.processwire.com/modules/markup-rss/? I've set up an RSS page and I'm just using $rss->render($items); to create the XML. I know I can use the description field, for example: $rss->itemDescriptionField = 'article_featured_image'; However this only outputs the fieldname; can I include the full path? $config->httpHost
-
I still have NO idea why I couldn't get the next repeater. Nonetheless, this is what I landed on. I've just seen your post @Robin S and your second example is what I went with. $page->article_overview_flexible_layout->getNext($layout); 'article_overview_flexible_layout' being the repeater and $layout being the value from the repeater (foreach $article_overview_flexible_layout as $layout). Thanks for all your help. It's bizarre it never worked when being logged out but alas.
-
I understand. It was merely a test to prove/test whether or not it was getting the next repeater row when logged out. Doing exactly as your code does, when logged out, doesn't work for me. Logged in it does. I'll go hunting. Thanks anyway for your help.
-
I worked it out as the following... $repeater = $page->get('article_overview_flexible_layout'); $count = $repeater->find('article_overview_flexible_layout_type=4')->count();
-
Thanks, Soma. I wonder if it makes a difference as I am doing this within the loop? It's weird that it would work logged in though (surely if it was wrong, it would be wrong regardless of the logged in state).
-
It doesn't seem like ->count() accepts a selector as when I put $page->article_overview_flexible_layout->count("ffvsdsdf"); it still returns 6.
-
Sorry, I didn't mean for my answer to be flippant. I've just been trying to figure this out for hours.
-
Thanks (again!) Soma. I did try this but it was returning all the repeater rows (6) rather than (3) which in this case is the number of repeater rows that has article_overview_flexible_layout_type set to 4.
-
Also this doesn't seem to work.
-
Thanks, Soma. $layout is each repeater row ($page->article_overview_flexible_layout as $layout) with 'article_overview_flexible_layout' being the repeater.
-
Same issue. I'm stumped to why you cannot get the next repeater element without being logged in...
-
I'm actually thinking it's because I am trying to get the next()-> item of a repeater, which is admin/logged in accessible only...? Update This is exactly the issue. I wasn't logged in on Safari and thus it couldn't get the next() element because the repeater is stored within the admin. How do I allow this?
-
Sorry these are ids of the option field 'article_overview_flexible_layout_type'. 1=Side by side (image on right) 2=Side by side (image on left) 3=Full image (text on top) 4=Small
-
It would appear ->next() is the better thing to use here BUT it still isn't returning correctly. I tried some tests. <pre> This: <?php echo $layout->article_overview_flexible_layout_type->id; ?><br/> Next: <?php echo $layout->next()->article_overview_flexible_layout_type->id; ?> </pre> In Chrome, I got, for one of the items in the repeater loop... This: 1 Next: 2 In Safari, for the very same item, I got: This: 1 Next: Notice: Trying to get property of non-object in /Users/john/Sites/website/site/templates/article-overview.php on line 130
-
I'm not sure because it's throwing a Notice error even when there is a next item. I've wrapped it in a check now; which seems to have removed the Notice (weirdly) but where PHP should be returning the element when 'article_overview_flexible_layout_type->id' is either 1 or 2 and the next is either 3 or 4... in Chrome it does... and in Safari it doesn't. Safari: Google Chrome:
-
I have a repeater set up 'article_overview_flexible_layout' and within each repeater is an options field 'article_overview_flexible_layout_type'. Before I loop through each repeater I want to get the total number of 'article_overview_flexible_layout_type' that equal the id '4'. I thought this (below) might've worked, but the main thing is that I don't want to loop through (foreach); is there a way to get the count as a single query? Thanks. count($page->article_overview_flexible_layout.article_overview_flexible_layout_type.id === 4)
-
Why does this only show in Safari and not Chrome? And why does it show this notice every time even when the next page does exist?
-
Even I test, within the loop: <?php echo $layout->next->article_overview_flexible_layout_type->id; ?> It outputs the correct id in Chrome but in Safari it doesn't and I get the notice (line 23 is the echo above): Notice: Trying to get property of non-object in /Users/john/Sites/website/site/templates/article-overview.php on line 23
-
I'm getting an odd issue where Safari isn't displaying a certain element based on an IF statement but Chrome is. I know... this sounds bizarre... and it's freaking me out. I have turned on debug and above where the element is meant to be inserted, on Safari ONLY, I receive this notice... Notice: Trying to get property of non-object in /Users/john/Sites/website/site/templates/article-overview.php on line 130 This line is as follows... <?php if (($layout->article_overview_flexible_layout_type->id === 1 || $layout->article_overview_flexible_layout_type->id === 2) && ($layout->next->article_overview_flexible_layout_type->id === 3 || $layout->next->article_overview_flexible_layout_type->id === 4)) : ?> <div class="article-overview-layout-sep"></div> <?php endif; ?> I have set up a data-type tag to output the 'article_overview_flexible_layout_type->id' and you can see in the screenshot that both Chrome (left) and Safari (right) is outputting this correctly. Any help or ideas? Why is it saying it is trying to get property on non-object? Thanks.