Jump to content

moonwhaler

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by moonwhaler

  1. Okay guys I am truly overwhelmed by your support. I think this is VERY rare nowadays.

    That really encourages me to support PW even more by buying some Pro modules soon. It's really, really good to have a community like this! :lol:

    @adrian: Thank you for you effort. After reading your code it gave me a more deeper understanding on where to put the hooks!

    @LostKobrakai: Your dedication is stunning. ;) And you're right: the "init" PHP is only executed front-end wise. Thank you for opening my eyes!

    Basically, you're right. Adding this hook globally to all pages might seem too much, but Soma does a little check before doing anything:

    if($table->name !== "mypagetable") return;
    

    I think the performance hit (if any) is still bearable.

    @Soma: Hero Member really suits you. I just copied your source from Git, installed the module and it worked out of the box! :rolleyes:

    I cannot mark two posts as "solved", so the "solved" goes also to yours, adrian!

    Just a short follow up to working with classes: since I'm outside the normal scope of the "$pages" object, I have to use the global (ugh) "wire('pages')" inside the class instead, am I right?

    • Like 3
  2. Hi everyone,

    after successfully solving the mystery "PageTable", I stumbled upon another one: removing the "add new" button from PageTable (in the template) via hooks.

    So, I read about hooks. I never implemented one myself, but tried using the "init" PHP file from the default site, but that didn't work out too well. So again I am a bit stuck in the process. :(

    Basically, I check if an array is empty. If it is, the PageTable field on my template shouldn't display the "add new" button. That's about it.

    Since PageTable is fairly new, I didn't find too much info about it. Maybe someone of you is able to help me?

    Thanks a lot!

  3. Thank you LostKobrakai! This works like a charm.

    One thing left though: when using "PageTable" and trying to add a new entry (Page) to the list, am I able to deny adding new "lineups" when there are no players / positions left to assign? Currently, I am able to add "blank" pages, since I have no more players in my Page selector.

    Thanks again!

  4. Hi guys,

    here's a short list of my fields:

    post-1971-0-08810500-1409259359_thumb.pn

    and my current page structure:

    post-1971-0-50693600-1409259359_thumb.pn

    Sorry, it's german for the most part, but maybe you get the idea. Basically, there is a page "game list", "player list", "jersey list", "position list".

    I already read that using simple "select" types is not recommended DB-wise, so I skipped that from the beginning. I mostly modelled the structure very similar to yours @LostKobrakai from the start.

    Apart from that, I really like the "custom PHP code" approach. I didn't really saw that when using "Page" as field type. I will try that ASAP. So thank you for the kickstart! Also thanks to adrian for the heads up on the "Auto Page Name Format". I will definitely use that! ^-^

  5. After playing around a bit with PageTable I don't think this is a really good alternative to Repeater fields. I understand that it may be better performance wise, but Repeater are superior in terms of user interaction. A PageTable (as far as I understand it) is "just" another way of adding sub-pages to a page and then displaying them in a table on the parent page.

    Repeaters, on the other side, are fast (looking at user input / UI wise) and responsive. Another thing is: I have to "name" a new page - in my case I have to name them "position1", "position2", etc. Repeaters don't need that (there's a automatic naming scheme #1, #2, ...)

    Coming to the crux of my initial question: connected data. Since I really am a n00b, I didn't find the "setting" to create a custom code block for handling my "selector" drop downs. As far as I understand my situation, I have to create a new "field type" to reflect that. Am I right? :-[

    Thank you!

  6. Yep. It has to be some sort of "self-aware" selector. It should only display the names of the players / positions that not have been used yet.


    Do you need this to work on the frontend or in the admin part of processwire. On the frontend you can just use javascript to disable already selected players / positions and check on the backend, if nothing has gone wrong, before saving it. If you want to use the backend of processwire I think you've to build a custom InputfieldPage module, which does the job of disabling parts of the selectboxes to make positions / players unique to one game.

    Only in the admin part. :)

  7. Hi there!

    The title may be a bit misleading, or at least it's how I tried to achieve something which may not be possible in that combination. But let's start from the beginning: I'm trying to create a football team & game manager with processwire.

    As someone who used Excel in all ways possible to manage every aspect of a football team (members, positions, games, etc.) and having used processwire for solely building websites in the past, I thought this has to work, too. And for the most part it does!

    Yet, I have a few things which may work even better and that's where I'm stuck.

    I currently manage:

    1. Team members (pages)
    2. Game positions (pages)
    3. Games (pages)

    In "games" I have something like "location", "opponent", etc. and I have created a repeater field which includes "team member" (selector from page "team members") and "game position" (selector from "game positions"). I am able to map a "position" to a "team member" for each game. That's fine & well, BUT: it would nice, to have those selector being somehow connected to each other in a way, that if I am selecting a team member and assign him to a position, that this position & member will be deleted from other repeater "selectors".

    This way I want to prevent a team member or game position to be used n-times in one game. It's just a usability thing, but a big one for me, since I may be not the person working with this in the future. :-[

    Is this somehow possible?

    Thank you!

    • Like 1
  8. Hi everybody!

    As I may have already wrote, I really like processwire. After a short time of not knowing whether this thing is really able to get everything going (= bigger more complex sites), this slowly kicks of. Coming from MODx processwire really is a treat - and a lot faster!

    So now: I just tried adding a new field which I named "book_exhibit_year" used the type "Datetime" and tried setting the "Date/Time Output Format Code" to "Y" (year with four digits) and also did the same with "Date Input Format Code".

    My customer wants to add his own "books" as child pages and requires them to have them sorted by exhibition year. To make it as easy as possible I want him/her to be ONLY to enter years - not whole datetimes... I also thought about just using a simple "text", but then I maybe not able to sort all child pages based on the year (?).

    Long story short: using only "Y" (see above) will not save anything. If I enter "2014" it will always reset to "1970". I suppose the datetime expects "good" (whole) dates... I'm out of ideas right now. :undecided:

    Maybe using a text field and then converting the value to a datetime object? ???

    Thanks!

  9. Hi there! Just updated to PW 2.4 - without updating the ModuleManager to 2.x, which worked fine. After that I added JQueryDataTables and then updated to the latest ModuleManager that gives me "400 Bad Request - Request Header Or Cookie Too Large" now.

    I'm using a Nginx webproxy/server via HTTPS. The logs do not tell me much (access.log, error.log is empty): 

    1.1.1.1 - - [06/Mar/2014:11:48:56 +0100] "GET /processwire-admin/setup/modulesmanager/ HTTP/1.1" 400 242 "https://bs.somedomain.com/processwire-admin/module/edit?name=ModulesManager" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0"
    

    So nothing to see here. Thank you.

×
×
  • Create New...