-
Posts
2,776 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Macrura
-
you have to find the repeater events for the month, so you first have to apply a runtime property to each repeater event for the the month... $newsletterrepeater = $thispage->newsletterrepeater; $months = array(); foreach($newsletterrepeater as $n) { $months[] = date("m",$n->getUnformatted("newsletterdate")); $n->month = date("m", $n->getUnformatted("newsletterdate")); } $months = array_unique($months); rsort($months); foreach($months as $m) { $monthName = date('F', mktime(0, 0, 0, $m, 10)); $monthNews = $newsletterrepeater->find("month=$m"); echo '<table><tr><th colspan="3">'.$monthName.'</th></tr>'; foreach ($monthNews as $archivenews) { echo '<tr><td>'.$archivenews->newsletterdate.'</td>'; echo '<td>'.$archivenews->newslettertitle.'</td>'; echo '<td><a href="'.$archivenews->newsletterlink->url.'">View File</a></td>'; } }
-
you can group by months by creating an array of all the used months: $months = array(); foreach ($newsletterrepeater as $item) { $months[]= date("m", $item->getUnformatted("date")); } $months = array_unique($months); rsort($months); to get your month name you can do something like this: $dateObj = DateTime::createFromFormat('!m', $month); $monthName = $dateObj->format('F'); but you probably need to do 2 loops where you do the years first and then the months within the years..
-
yes i would do piwik in a subdomain
- 4 replies
-
- 2
-
-
- root
- sub-directory
-
(and 1 more)
Tagged with:
-
that is really cool - hopefully others find it useful also; i was able to create a 'restricted' role with that permission, and add it to selected superadmins on the project, and now they have a much smaller, restricted set of tracy items – working great! thanks as always!
-
right - ok thanks, sure - yes, a per-superuser permission is best, to limit the panels, or none at all (sorry for being dense, doing like 10 things at once here..)
-
When i posted that, i hadn't registered that you made the user bar; I haven't used the module config for this enough to be able to give a coherent answer about the panels but will study and return with more comments.. Hopefully i set this up right – i created a new permission called tracy-debugger-superuser, then i created a new role called 'developer' and then added that permission to that role; so now only people with the developer role should be able to see the tracy debug bar (?)
-
checking this out now, so the new user bar solves this i think..
-
no, i don't think i ever mentioned it; it's just sort of a part of this ad-hoc sub-framework i use for developing sites..., and came into being way before Tracy was born... I do use it extensively since it would show for non superadmin under circumstances where Tracy might be confusing; this one is super simple and just shows a handful of links to the site editors/managers.. on the next project, i am going to pursue using Tracy instead of this, and i'll post back here in terms of how it works out with using the php code...
-
wow, that officially makes my custom admin bar obsolete... would probably just put a function call there and then hook into that function on a template-by-template basis (e.g. some templates need specific links - if there is a feed, then i put a feed validator, if there is schema, i put a structured data test... )
-
no pick a template - the repeater field itself becomes the sub-fieldgroup ('template"); you probably just need to use ACF to do some CSS and JS adjustments to disable/hide the "add new item"
-
@giannisok thanks for this post! though we probably need to move your post to it's own thread, as this topic is for the Module by @justb3a
- 76 replies
-
- 1
-
-
I think what you are proposing might be doable now with a repeater field, somehow set to a maximum of 1 item... seem to recall this being discussed not too long ago... i do agree that if you did have some common set of fields you wanted on a lot of templates, there could be some way of improving things to allow for it. One example that comes to mind is that on almost all recent projects I have done, we have had a set of fields that allow users to flag pages (with stuff like statuses/issues) and these fields include around 3-4 fields that all need to be on the template and have certain conditional visibility settings common to them. I do recall that it was a pain to add those same fields to all of the templates that needed them...
-
@adrian quick question - is it possible have Tracy active only for only select users, or limit by IP? The current behavior is that tracy is active for all logged in users, unless you specify the IP but the IP only prevents non superadmins, seems to be always active for all superadmins..
-
ok - any other info on that error - line # or anything - it is probably something about you need to set the theme... i will see about fixing it asap
-
Displaying a Random Image from any web page
Macrura replied to mcgarriers's topic in General Support
it should be functionally equivalent to product_images->find('tags=prod') would need to see full code you are using to assist further, as well as the exact error message; this might also be helpful: https://processwire.com/api/ref/pagefiles/find-tag/ -
Displaying a Random Image from any web page
Macrura replied to mcgarriers's topic in General Support
ok b/c you used getTag which only gets the first, have you tried findTag yet (returns WireArray) -
you might try using Tracy debugger, this way you can bd($str) inside the function when viewing the frontend and see what's going on there.
-
Displaying a Random Image from any web page
Macrura replied to mcgarriers's topic in General Support
one problem with this is that i think you wanted to use findTag('prod')->getRandom() (?) -
show field dependence on one ore another......
Macrura replied to ChriWolf's topic in Getting Started
wow, that's awesome, i can't imagine how many places i could have really used that in the past year...dude i gotta go back and revisit a lot of template editor setups if this is true... are you sure this works! -
show field dependence on one ore another......
Macrura replied to ChriWolf's topic in Getting Started
See https://processwire.com/api/selectors/inputfield-dependencies/#limitations -
ok - sure, I can add CSS to help this issue - i will try adding overflow: hidden to the UL and update the module (might not get to it till Sept. as i'm away at the moment...)
-
Inputfield Depencies, referencing container page from inside PageTable
Macrura replied to juhis's topic in General Support
the way i do it is to create a Runtime Markup field that outputs a value, for example the name of container page template; then you can reference that value in your conditional visibility. -
ok sorry about that limitation; so far i haven't noticed any limitations in terms of length of content, and i have some really long paginated articles. Will have to see if i do in fact have anything longer and 1200 words
-
yes, it works on default theme (needs some CSS adoration on Reno)
-
The operating assumption here is that you are using Processwire, so yes, it is a factor. If this assumption is true, then you'd simply need to use the fantabulous Jumplinks module. And also it is curious that your target URLs do not have trailing slashes, which is the default for PW. If you have not changed the default behavior, then you'd be getting a 2nd unwanted 301 redirect to the trailing slash.