Jump to content

pppws

Members
  • Posts

    46
  • Joined

  • Last visited

Recent Profile Visitors

2,020 profile views

pppws's Achievements

Jr. Member

Jr. Member (3/6)

3

Reputation

  1. Hi there, I created a files field which is already populated with images and videos. this field functions as the data for a slideshow. which works fine. but i need to resize the images, which does not work because the files field doesn't allows the ->size command. Is there any way to seperate the images in the files field in order to resize them? edit: i already tried to create a new pageimage: $image = new Pageimage($page->images, $slide->filename); which results in an error: Aw shucks… Fatal Error: Uncaught TypeError: Pageimage::__construct(): Argument #1 ($pagefiles) must be of type Pagefiles, null given, called in <u>site/templates/basic-page.php</u> on line 19 and defined in <u>wire/core/Pageimage.php</u>:162 Thanks alot! Philipp
  2. Ahh… no… i just fucked up the order of code… it was too late... hahah. thanks guys!
  3. hey there, i'm pretty sure it's a dumb question, but im getting console errors for unexpected tokens: < var cal = $( '#calendar' ).calendario({ displayWeekAbbr : true, caldata : { <?= getEvents(); ?> // this is our function to grab our events } });
  4. hey there, i migrated my local website to the liveserver and the frontend is running just fine. however i get some errors in the backend which make the site unusable: when trying to access some of the templates i get the following error: Error: Cannot access self:: when no class scope is active (line 96 of /hermes/bosnacweb02/bosnacweb02ad/b1909/dom.hexiangyucom/2018/site/modules/ProcessSetupPageName/ProcessSetupPageName.module) This error message was shown because: you are logged in as a Superuser. Error has been logged. when creating new pages or saving older pages(with the same template) i get the following error: Error: Using $this when not in object context (line 90 of /hermes/bosnacweb02/bosnacweb02ad/b1909/dom.hexiangyucom/2018/site/modules/ProcessSetupPageName/ProcessSetupPageName.module) This error message was shown because: you are logged in as a Superuser. Error has been logged. so i'm guessing somehow my template(s) are broken, but locally they run fine – how do i fix this error :/? thanks in advance! edit: i just moved the installation to another server –– and it's working fine. any idea why it isn't working on the first server? edit2: php version caused the problem.
  5. Hey there, for a current project i'm using the 'PageTable' Module, which works great! I created several 'modules' (PageTables) that the user can choose from. I also allow the user to set a 'checkbox' to display an excerpt of the page on the homepage. Now it gets a bit tricky: when a page contains an 'event'-module, the event module gets also displayed on the frontpage. which also still works. my problem is that the ->url (obviously) returns the url to the page used by the PageTable field and not by the 'parent'-page. for better understanding: // get all pages (modules) with template 'event' $featured = $pages->find('template=Veranstaltung, sort=-module_event_datestart, module_event_dateend>=today'); // get all pages marked with frontpage $featured->add($pages->find('frontpage_show=1, sort=created')); i loop through all the posts with some if statements e.g. for 'events' <?php if ($child->template == "Veranstaltung"): ?> <div class="article__event"> <?= $child->module_event_text ?> <a class="article__readmore" href="<?= $child->url ?>">read more</a> </div> <?php endif; ?> All pages created by the PageTable module are stored in a page called 'never touch', so the $child->url returns something like: 'never-touch/never-touch-2018-2054/' What i need is the url of the 'real' parent page. so if the event is created as a module of the page 'Exhibitions' i need to return the url of the 'Exhibitions' page and not of the PageTable page ('never-touch). thanks for any tips! philipp
  6. Hey there, i've set up a page wich uses pageTable and it works like a charm. for my home page i get several pages. they are sperated in two types: a) page has the module 'featured_img' b) page doesn't have the 'featured_img' my pageTable field is called add_modules. so i was wondering if something like <?php foreach ($featured as $child): ?> <?php if ($child->add_modules->module_featuredimg): ?> // show image <?php else: ?> // show text <?php endif; ?> <?php endforeach; ?> is possible? thanks for your input!
  7. hey, maybe a super dumb question and i bet there is a super easy solution to this, but i can't find it and obviously i'm too stupid to google the right words… but how can i change the date format for from '4 weeks ago' to the acutal date? ('first saved by user' is a field created by me, so i can change it for this field). thanks for any help!
  8. no, i want all of the repeaters sorted by month. not only their parent pages. the screenshot shows all pages wich include a repeater field with the year 1969. the names are the names of the pages. the second number is the month (1 = january, 4 = april and so on) but i don't need the pages to be sorted, but the repeater fields. so the list should be: julio, 1 selva, 4 gloria, 5 gloria, 5 gloria, 6 miguel, 6 sandra, 7 catalina, 8 luis, 10 hilda, 11
  9. this actually changes the order, but not in the way i need it.
  10. hey there, i have the following structure for a repeater field: moments, 10x per page (unfortunatly a lot of pages, roughly 400) -- yearofmoment -- monthofmoment -- textofmoment i'm trying to find all repeater fields of certain year and sort them by month. e.g. get all repeater fields of year 1969, first repeater to be displayed: repeaters with monthofmoment = january. i already got this: <?php $langname = "es"; //temp: only get spanish profiles?> <?php $persons = $pages->find("template=persons, lang=$langname, moments.yearofmoment=1969") ?> <?php foreach ($persons as $p): ?> <?php foreach ($p->moments as $moments): ?> <?php if ($moments->yearofmoment == 1969): ?> <ul> <li><?= $p->givenname ?>,<?= $moments->month ?> <?= $moments->yearofmoment ?></li> </ul> <?php endif; ?> <?php endforeach; ?> <?php endforeach; ?> but somehow i can't figure out how to sort the repeater fields by month. the code above gives me this result: (julio should be on top, luis the last )
  11. ohhhh! somehow i missed the notifications for your answer! but it works! thanks a lot! whooooo.
  12. hey there, i have a form to create repeater fields on the frontend via the api, which works fine. if(count($newMoments)) { $page->moments->removeAll(); $page->moments->add($newMoments); $page->save("moments"); //$page->moments->sort('yearofmoment, month'); //$page->save("moments"); //echo "saved professions"; } but now i'm trying to autosort them when/before (?) saving the page. on top you see one of the attempty i've tried to get this done. by now i know that i have to put the sort function outside the if() because sometimes there will be no now moments, just editing of the existing ones which could cause a new sorting as well. so i put it here right under the if(). which causes the 'moments' to be sorted after submitting the form. but after a reload the the moments get back to the order in which they were entered. and in the backend nothing changes at all. what am i doing wrong? do i have to use a usort() function to sort the $newMoments php array? thanks for any help!
  13. hey there, i know it's a kind of dumb question, but… is it possible to duplicate the "name" field in the backend and output the whole page URL in the input? i know that i can copy the link when right clicking on it, but just a input field with the whole URL would be more comfortable (in this case). the second field (ES) illustrates what i mean. thanks for any help!
  14. hey there, i'm creating new pages via a form – which works great. to prevent the same pages names i try to validate the inputfield for duplicate entries. in the form i ask for the users e-mail address which becomes the title for the page. i modified the given example (don't allow hotmail e-mails) to this: // here is a good point for extra/custom validation and manipulate fields $email = $form->get("email"); // check if e-mail already exists if($pages->count("email=$email, include=all") > 0){ // attach an error to the field // and it will get displayed along the field $email->error("E-Mail is already in use."); } the form still gets processed and returns a php error: which i'm trying to avoid by checken for duplicates upfront. when i'm using $page->count("email=$email, include=all") > 0 on a test template it returns the right value.
×
×
  • Create New...