Jump to content

LostKobrakai

PW-Moderators
  • Posts

    4,954
  • Joined

  • Last visited

  • Days Won

    100

Everything posted by LostKobrakai

  1. Hi, for my current project I'm building userprofiles, where the user has the ability to deny infos to be shown to other users. What would be the best way to build this. Currently I simply plan to use a textareas field which each field names and true or false as string, to save the visibility options. But it would be quite a pain to write all those if statements to check for the current setting all over the templates. For profile images I have a function which either returns the user image or the image from the global default settings ("getProfileImage($user);"). But writing and maintaining 20-30 more of those is also a way I would like to avoid. So does somebody have a idea to solve this a litte more automated?
  2. Why did I see this just after setting up four kinds of categorizations on my current project. Next time I need it, I'll install this module.
  3. This is really nice, especially if you use the dev version and want to stay up-to-date.
  4. @Soma Thanks for your example, but the errors I posted above are happening while "$form->processInput()". I've read the thread and your previous examples, but I can't see what I'm doing different.
  5. I'm trying to get a image upload working with the form api. $field = $modules->get("InputfieldImage"); $field->attr('id+name','images'); $field->required = 0; $field->destinationPath = $config->uploadTmpDir; $field->extensions = "jpg jpeg gif png"; $field->maxFilesize = 2*1024*1024; $field->maxFiles = 1; $field->skipLabel = Inputfield::skipLabelBlank; $form->append($field); But if I call $form->processInput($input->post); I get this error: Error: Exception: Nicht zulässiges Bild (in /Users/Benni/Projekte/A-06-2014_HONourables/www2/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module line 282) or with InputfieldFile Error: Exception: New page '/mitglieder/postfach/conversation-2014-09-06-10-59/' must be saved before files can be accessed from it (in /Users/Benni/Projekte/A-06-2014_HONourables/www2/wire/core/PagefilesManager.php line 240) I don't understand why this is trying to create a page in this location, which is the location of the page, which shows the form. The file is supposed to be for a page further down the hierarchy. Also the only template allowed as child of "postfach" doesn't even have a image field which could serve as temporary storage. I could use own upload processing, but I would much rather stay consistent with the form api.
  6. By now the slider expands always to full width, just the images are to small. To fix it I would suggest the usual way: max-width the slider to the image width and center from there. Same with the twitterbar.
  7. The twitterbar and the slider on the frontpage would need some extra work for big screens. They float to the left on an 27" iMac, while everything else is centered.
  8. I'm currently using a dual approach. Fields like addresses and single information fields are within the user template, while conversations are own pages linked via a pageTable field. It made more sense to store conversations / single messages in a centralized fashion instead of combining them from different user pages.
  9. I've just tried to add subfields as columns via the api, but it seems these are not supported. Can someone confirm this? I'm working a lot with pageTables and it would be great to show a count of them instead of an empty field, because I don't use the title field in this occasion. Also the fullname field of my users would be super to access instead of the raw name field.
  10. A small thing I found: The border of the dropdown navigation has a fixed width because of the img solution, to narrow for the widest layout and to wide for the smallest layout. There are ways to get a gradient with css and pseudo-elements and even gradients as normal borders are doable. I don't know which browsers you needed to support, but this would be an enhancement. Edit: Just before the layout switches to the mobile view, the top bar navigation stacks vertically.
  11. One working and from all browservendors agreed standard would be sufficient.
  12. Under the curcumstance, that the frontend doesn't only display one single dateformat, the advantage of using my suggestion over "none" as output format is the display in the admin backend. PageLabels or PageTables benefit from displaying a readable date instead of the raw timestamp. All the actuall input fields of the backend are, of course, controlled via the input format.
  13. No. The output format is only used on formatted output like "$page->date" while getUnformatted() returns the raw date as timestamp. These can easily be used by the php date functions. So there's no need to hijack the integer field to save dates.
  14. Hi, is there an easy way to get PageTables to render wysiwyg content instead of displaying the markup. Or at least hide the markup.
  15. The input formats are the format's which are used by the backend input fields. The output format's are the ones you get if you call "$page->date". There you should use the date format you're using the most. To get other formatting just use this: date("DATEFORMAT", $page->getUnformatted("date"));
  16. If I understand the description right html purifier does only strip/change malicious and malformed content. So the allowedContentFilter of CKEditor would be the issue. With a look in the docs you find that adding "div[*]" allows for every kind of div to be present. Also there's a new option in the dev version, which converts divs to p tags. So this has to be disabled, too.
  17. If you're running the dev version, this should be present: https://github.com/ryancramerdesign/ProcessWire/tree/dev/wire/modules/Inputfield/InputfieldPageTable
  18. @yesjoar You need to install the dev version of 2.4 instead of the stable one. PageTable is a new Fieldtype which is only available with the dev version.
  19. The Slashes ( / ) are a php specific thing to implement regex patterns, while the two patterns below are different ones. The first one does only match if the input is a single word, while the latter would also match "Passwrd Passwrd" see: http://regexr.com/39e12 vs. http://regexr.com/39e18 Edit: To answer a little bit more clearly, the second one is the one you should put in the field of the processwire backend, to reflect the first pattern.
  20. I don't know if I'll need it in the near future, but it's indeed a great enhancement.
  21. // _init.php $GLOBALS['gallery_used'] = false; // _func.php function renderGallery(){ if(!$GLOBALS['gallery_used']) { $GLOBALS['gallery_used'] = true; return "gallery"; } else { return "already used"; } } With the exception of an error in the order your solution does work horst, thank you both.
  22. A simple edit link can be done with ease. Regarding in place editing: I think especially for non professionals it's important to make them aware of the fact, that websites don't come in one shape. There are mobile layouts, responsive layouts, maybe a rss feed, which is shown in a rss viewer. Ryan already talked about that earlier in this thread. Nobody wants to have content with 15 " "'s just that the next word flows to the next line. If you just don't like your client to have to leave the current page to edit, take a look at this: http://modules.processwire.com/modules/fredi/.
  23. Hi, I've a function which outputs gallery markup. This gallery can be included in the text via a hanna code or should be placed below the other content. Somehow just setting a variable at the start of template rendering and use "global" to change it doesn't work. // _init.php $gallery_used = false; // _func.php function renderGallery(){ global $gallery_used; if(!$gallery_used) return "gallery"; else return "already used"; $gallery_used = true; }
  24. LostKobrakai

    Barcelona

    Where there with my class before school graduation. If you're into arts the stuff gaudi build all over barcelona is worth a visit as well as the Picasso museum. From the "Castell de Montjuïc" you can have a great look all over barcelona and the harbour.
  25. Sadly there's no documentation about the progression of functions there's only this http://processwire.com/api/hooks/captain-hook/ to find hookable functions. But often the hooks are quite declarative. You want your error handling to happen when a page is saved => Page::save. Another example, when a new Page is added to the tree => Pages::add and so on. Your example of Page::render or InputfieldTextarea::render does not make sense for error handling, as this functions only generate markup. Also it's called if someone opens the page, to late for useful error handling, as the user has to reopen the page, before getting the errors.
×
×
  • Create New...