Jump to content

nuel

Members
  • Posts

    12
  • Joined

  • Last visited

About nuel

  • Birthday 12/27/1982

Contact Methods

  • Website URL
    www.nuelschoch.ch

Profile Information

  • Gender
    Male
  • Location
    Zurich, Switzerland

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

nuel's Achievements

Jr. Member

Jr. Member (3/6)

2

Reputation

  1. Hi I'm working with PW for some time now, but – please don't laugh – never used hooks. I have 200 – 300 subpages with the template 'artist', the title of each page represents the full name, sometimes John Doe, sometimes John Emmet Brown Doe. I want to auto-populate the field 'artist_last_name' with the word that is most likely the last name, the last word of the page title. If there are more names, it can be changed manually. I need this for easier and quicker alphabetical sorting. What I put together is this, in ready.php. Doesn't work. Again, I'm new to hooks.. <?php $wire->addHookBefore('Pages::saved', function(HookEvent $event) { $p = $event->arguments('page'); if($p->template != 'artist') return; if($p->artist_last_name) return; $ln = end(explode(' ', $p->title)); $p->set('artist_last_name',$ln); }); ?> In the best case this would be done once globally without having to open and save every page. But new pages should populate the field on page save. Thanks for your help, I think it's easy, I just need a push.. Nuél
  2. Ok, 5 minutes later, I just made it work again. I have two textarea fields with custom styles only available in the second. That doesn't work somehow. Had to add the styles to the first field as well, now it's working in both. Tested it twice.
  3. Hey People Jon, was this issue ever solved? I'm experiencing something similar too. My custom styles basically work perfectly, as usual (modified clone of contents.css and mystyles.js), but now they are not accessible in certain templates. Same field, other template. Any ideas? I'm running 3.0.184. Thanks, Nuél
  4. Thank you so much Moritz. This is even longer than I expected 😄 It sounds like the perfect solution for this and will definitely be my long-term goal – maybe even with the possibility to restrict the visitors location to a country or region. I know and use the modules you mentioned, on the other hand – please don't laugh – I've never worked with hooks yet. This is new and I'll need some time to try that 😕. One thing got missing here and this probably makes it even simpler. The ticket codes come from an official ticket service where people buy real tickets for real concerts. So for this I won't have to generate codes on request/order and handle payments. So I will (or my customer) most likely have to import or copy/paste these codes. I have to check but I think the gag would be to enter the «online concert venue» with only a code and without a user account or name/password. So I will have to try to store the code along with the visitors IP address in the codes table. I will get back here and post my solution or further steps or questions.
  5. Dear PW Community Let me shout out my question here, I really don't know where to start and hope someone can give me a hint or tell me to resign and go home and cry. I want to create a subpage that is only accessible to people with unique access codes. It's gonna be an online concert streaming page (thanks Corona!). People who buy tickets through a local ticketing service should be able to access and stream the show with their individual access code. These codes should work only for this person and show. If someone in the «audience» closes and reopens the page, they should get in again, but not their friends who were given the code of course, basically just like in a club with a ticket and a stamp on the wrist. Now, is there a possibility to achieve that with more or less basic Processwire skills? In my imagination I have a field where I list the given access codes, another two to add start and ending date/time of the show, maybe one for a unique ID/title of the show. Is there an existing module for something like that? Should I get into the module development field and create that? How?? Haha. Any comments are welcome here. Thanks, Nuél
  6. Hi guys. I have a similar problem and dug out this thread, maybe some processwire wizzard out there can help me =D I «gather» pages and subpages with a certain checkbox checked with $pages->find("checkbox=1"), ordered according to the page tree. sort=sort works quite right but it messes up the order of subpages. Example: page1 (checked) page2 –> subpage2.1 (checked) page3 page4 (checked) Now what I want to get is page1 | subpage2.1 | page4 but what I get with sort=sort is subpage2.1 | page1 | page4 Any ideas? Cheers, Nuél
  7. Wow, thank you guys! Great inputs. I will try all that. For now I built the whole download page on a subdomain where i forward to in the /download template i forward with $session->redirect($url). It works, but it's not the beautiful solution I was hoping for (dynamic menu etc. is not affecting the subdomain etc.). I will post my solution here when I succeed.
  8. Hi there Basically I want to call code within a ProcessWire page that isn't used as a template. Example: www.mypwpage.com/myphpfile.php I have a working PW Website with a couple of pages like /artists, /releases, /videos etc. Now I need a page /download without any editable fields in the backend, just calling some PHP code (that was coded by another guy) containing a form that checks unique download-codes in a second database and starts the download of the desired file. The script is working fine right now as part of a static website, but since I built PW behind the site, this independent «Download Section» of the page doesn't work anymore. Right now I have the main file download.php as a page template on a newly created empty page called /download, so until now the form is working (wow). After sending the form containing the download-code, the file check_code.php in a subfolder /site/templates/download is called and that's where I get an error. Any help?
  9. hi there i'm new to processwire, please cut me some slack if the answer is already out there.. i am "processwiring" a non-cms page that i made, containing many repeating so called "station"-elements with fields such as date, location, miles, optional links, photo upload etc. they were listed and created via php and stored in an xml file until now: <stations> <station> <date>17.8.2017</date> <location>Exil, Zurich</location> <miles>1234</miles> ... </station> <station> ... </station> </stations> i already created a working repeater field with the needed fields and successfully created the first two elements... but there are many more! what is the easiest and quickest way to batch create new repeater fields with the node element content of my xml file? otherwise i would just have to type the whole sh..t again which i am too damn lazy to do thanks in advance nuel
×
×
  • Create New...