Jump to content

blynx

Members
  • Posts

    174
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by blynx

  1. Hi! I haven't looked into your project in detail yet - but as far as I can tell there is no function to generate the forms in the repository, yet? I had a similar idea today when I was building this module: https://processwire.com/talk/topic/11160-textformattervideoembedoptions/ I don't know if this could actually be helpful for you - also, maybe you can have a look and say what you think if you like to. But Iguess my implementation is pretty simple ... I wonder if it makes sense to separate this functionality (to generate forms out of JSON-descriptions) into an standalone module? cheers, Steffen
  2. Hi, this is a textformatter-module to globally set all kinds of YouTube and Vimeo options to embedded videos. It works well with TextformatterVideoEmbed and I think also with TextformatterOEmbed - https://github.com/blynx/TextformatterVideoEmbedOptions ... this is my first module - so I hope the code is acceptable ... ; ) What do you think about the way I implemented the configuration? I Seperated all the config and defaults into a JSON file and generated all fields automatically ... I was wondering if this was already possible or a good idea at all here: https://processwire.com/talk/topic/11155-create-inputfields-from-json-array/ Looking forward hearing your feedback! Cheers, Steffen
  3. Cool, thanks - I will have a look into this! I am building a module with quite some settings and with such a function i could handle all the data just in one place since the forms will be auto-generated.
  4. Hi, is there actually a function in Processwire to create forms from a JSON array with corresponding attributes, so that something like { "title":"Duck Count", "type": "InputfieldInteger", "label": "How many ducks?" },{ etc ... } would become a form with all the fields? Otherwise it would be a nice-to-have I guess? I will give it a try for a module now - could be enhanced then. Or has anyone already build something like that? cheers, Steffen
  5. But that doesn't help much with inline Videos which are put somewhere, whereever in whatever textarea? Unless in combination with Hanna Code ... ! Btw. I made this module to be able to adjust some youtube embed options (my very first module btw.) ... https://github.com/blynx/TextformatterVideoEmbedOptions Not super useful - but for now it works in my project. I am thinking about how to make this thing actually useful considering real use cases. edit: I already found some stupid elementary glitches in my module I will fix soon. And also as an reply to below: But what about many different videos pasted into one single articel‽ : )
  6. I had a problem with this error "Call to a member function isLoggedin() on a non-object" when using the login-code from Ryans very first post in this thread here. Just like adrianmak here: https://processwire.com/talk/topic/8835-cause-internal-server-error-when-login-with-a-wrong-username-or-password/ The code at the very beginning of this thread goes like this: $user = $sanitizer->username($input->post->user); But that is bad because $user gets overwritten !? Jan Romero gave the answer in that other thread ... Now I use this and everything is fine: $username = $sanitizer->username($input->post->user); $pass = $input->post->pass; if($session->login($username, $pass)) { $session->redirect($root_url."login/"); } Could be related to some other bugs on this forum? When you search for "Call to a member function isLoggedin()" you get some topics displayed - maybe the examples at the beginning should be corrected!?
  7. Just for the files: Meanwhile I just grabbed the missing IDs per plain mySQL-queries: $config->usersPageIDs = array(29); $new_users = array(); $xyz_db = new PDO('mysql:host=localhost;dbname=bzzzzt;charset=utf8', 'root', 'root'); $xyz_stmt = $xyz_db->query("SELECT templates_id, id FROM pages WHERE templates_id = 46"); $xyz_results = $xyz_stmt->fetchAll(PDO::FETCH_ASSOC); foreach ($xyz_results as $row) { $this_id = $row["id"]; $new_users[] = $this_id; } $xyz_db = null; $config->usersPageIDs = array_merge($new_users, $config->usersPageIDs); (I just figured that this could be simplified ... ... later ...)
  8. Hi! I am building a site where there is another user-template as introduced in 2.5.14. (http://processwire.com/blog/posts/processwire-core-updates-2.5.14/#multiple-templates-or-parents-for-users) For now, you have to add the parents of the users with the new user-template manually like so: $config->usersPageIDs = array(29, 1026, 1027); But I have dynamically growing pages which hold the new users, like so: Home Members Group User User Group User User ... ... Ryan mentioned they're working on automating that process, but I wonder how I could accomplish this now. Naively I tried to fetch the parents like so, directly in config.php: (I'm quite novice ) $those_pages = $pages->find("template=that_template"); But that failed - nothing got rendered. Then, I thought I could do that in the site template files. But that would be too late, I guess? Also this approach would be useless for the backend... and I guess I don't need this configuration for the fronted anyway!? Now I wonder where would be the right hook to some function in the right time to accomplish this? Or any other solution? Hope you get what I mean ...
  9. @marcus I thought about that but I don't want to spam the roles with hundreds of groups. Also I could add another page which hold those groups which hold the according users. I will try to do this now - but I thought that first solution would be something clever and 'semantically neat' ... uhm or so ... edit: @adrian Aha! I think I will try out the latest dev version - I think this is exactly what I thought of! Thank you, both of you!
  10. Hi, is it somehow possible to add new users as children of other users? I want to group users and thought that would be a nice structure to have groups of users put together as children of other users. Basically like: Users Group A User 1 User 2 User 3 Group B User 4 User 5 User 6 User 7 ... I edited the user template to be able to have children and parents of user-templates - yet, whenever I add a child to a user it automatically will be appended to the 'Users' page. Also I cant move them from there, it says "You do not have permission to move pages using this parent - /backend/access/users/group-a/" Couldn't find a solution so far - I think there is some intention behind it, because it is some admin/system stuff - but couldn't it be made possible? -Steffen
  11. yup, thanks! $pagesOfCat = $pages->find("project_categories.title=$thisCatTitle"); does it.
  12. Hi! I couldn't find an answer to this, so far - hope this question is not too trivial ... I am building a simple portfolio site and use categories like so: I retrieve the categorized pages via $pages->find("project_categories=$thisCatTitle") Where project_categories is a single-page-page-field and $thisCatTitle are the titles of all the categories there are I get via $pages->get("name=categories")->children And it gets all the pages wich are filed under categories like "123abc, abc123 or abc" ... but not the pages with numeric-only "123, 2010, 2011"-titled/named categories. So, I guess numeric titles are treated differently somehow, but why? How can I get my numeric-titled-category-pages with this method? Otherwise I have to think about another approach. It would be nice if someone could help me out or enlighten me a bit here - Thanks! (And thanks for that so far pretty amazing cms!) -steffen
×
×
  • Create New...