Adam Kiss
Moderators-
Posts
1,303 -
Joined
-
Days Won
7
Everything posted by Adam Kiss
-
I once heard that you should use integers for these kind of data, as in instead of $3.256 you'd have 3256 fractions of a cent (and do int calculations with that)
-
Hah, Soma! That is because most people probably don't notice your subtle changes/fixes after wrong-but-really-quick posts
-
I'd say that if your faq is really long you should categorize it more, split it into sections.
-
Trying to get the first object with a condition
Adam Kiss replied to tinacious's topic in General Support
Shouldn't that be $events->first() ?- 16 replies
-
- conditional
- foreach
-
(and 1 more)
Tagged with:
-
Oh you guys! In case you didn't know Thomas, ProcessWire has this repeater field… oh, well Good work, good selection for first site, and until you are all like 'pretty straightforward', it's going good.
-
That's exactly what he's "guessing"
-
There is a 'special' field, called "FieldsetTabOpen". When you add to your template, it actually (unlike other fields) adds 2 items into your list - "FieldsetTabOpenName" and "FieldsetTabOpenName_END". This then creates new tab in your editor (when you edit page). So, if you want some fields on different tab, you create this field (the tab basically), and move all field you want to have on this tab between the opening end the _END item (in your template's field editor).
-
Tracking changes on pages – getting original value
Adam Kiss replied to Adam Kiss's topic in API & Templates
@teppo: I do this, and generally am pretty competent at finding what I want via searching in /core/*; But so it seems that sometimes, probably particularly when I'm thinking about multiple things, I tend forget some obvious solutions (such as searching through forums). Oh well. Thank you though -
Tracking changes on pages – getting original value
Adam Kiss replied to Adam Kiss's topic in API & Templates
Hm, okay, I did Soma's way (thus not comparing original/new value, but rather querying for related pages, and changing them on the run). I now react to P::save() and to P::delete(), but what is the event for un-trashing page? P::save()? --- Edit: okay, less asking, more trying. P::save() works for pages that were undeleted, so it's okay. -
Of course you can: http://processwire.com/talk/topic/2010-fieldtype-for-storing-tags/
-
Tracking changes on pages – getting original value
Adam Kiss replied to Adam Kiss's topic in API & Templates
Yeah, I already see some things I might simplify Anyway, you've probably saved me at least an hour or two, so thank you for that! -
How to insert/register code before closing </head> or </body>?
Adam Kiss replied to titanium's topic in General Support
Since PW doesn't generate any HTML, there is actually multiple ways to do this; Based on how often you do this, you might either go with luis' solution, or you might do something more robust. for instance, if you only need to add one file per template, you can do this: <?php // in template $footer_js = '/path/to/my_file.js'; // in footer.inc if (isset($footer_js)) { echo "<script type='text/javascript' src='{$footer_js}'></script>"; } You can make this accept arrays, whatever you want, really. -
Tracking changes on pages – getting original value
Adam Kiss replied to Adam Kiss's topic in API & Templates
this? https://gist.github.com/4335296 btw, that is awesome, thhanks --- edit: I'm slow asshole. Thanks Soma, I'll check the code, and will be happy, probably --- edit: is this meant to be reusable, or should I adapt it? -
Tracking changes on pages – getting original value
Adam Kiss replied to Adam Kiss's topic in API & Templates
Thanks Steve, I've seen it now, but it seems awfully more complicated than what I need. My situation, in reality, is that I've got item1 template, which has page field that links to item2, which is one way connection. I want to hook to beforesave and modify page field in item2 (where applicable), so I may have two way connection between them (and synced). Example: item1 (page id 3000) has one page it links to, page with template item2 (id 4000). If user-admin changes it to item2 id 5000, before the page is saved, I'll go to page 4000 and remove the link, and then go to 5000 and add the link to 3000. and then just let the page save… boom, saved with two way connection -
Tracking changes on pages – getting original value
Adam Kiss replied to Adam Kiss's topic in API & Templates
Teppo, thank you. I am an idiot for not searching forums first. -
Tracking changes on pages – getting original value
Adam Kiss replied to Adam Kiss's topic in API & Templates
I should note, that this is for small website, so I don't mind loading the original page again, into different variable, and comparing it. However, another $pages->get() call gets me the object already in memory. -
Hi, I've been going through API, but I seem to not find what I'm looking for. For one of my websites, I'd like too hook before pages::save() to get all changes on website, and change other, related things based on them. However, I need to act not only upon new value (available via $page->field, $page->get('field'), ...), but I'd need to have access to old value as well. Is this possible somehow? Thank you, Adam
-
I think Joss is accountable roughly for half of that?…
-
"Continuous integration" of Field and Template changes
Adam Kiss replied to mindplay.dk's topic in General Support
You should have the changes available in $page->trackChanges() ? Edit: or foreach and use $page->isChanged('field') for each field. -
1.) I don't think there currently is any nation-specific PW site, maybe short of finland (and that's only because Antti (@apeisa) is a beast) 2.) Whether anybody is working on it, I'll leave that up to german boys --- + RANT: What the hell is that argument that "our clients heard about these before". Well, they are the agency, they should make the freakin' technical decisions! I will never understand this 'client asks for it, we bend forwards and backwards to do it' mentality… Especially when it comes to technical decisions.
-
There is a 'label' select where you should pick title (or another, good property) - see here: http://o7.no/VarKm9
-
[removed spam image]