Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/12/2014 in all areas

  1. Hey, I finally finished a lot of changes on my personal website like responsive, an about site, a better reference page, ... and of course an update to PW 2.4 Check it out: http://nico.is / Nico
    6 points
  2. -------------------------------------------------------------------------------------------------------------------- UPDATE: This module is not supported. It was only working for PW versions between 2.4.3 and 2.5.11 But since PW 3.0.10-devns, there is core support for the Imagick PHP extension, and with third party modules ImageMagick_CLI and Netpbm_CLI is supported too. And I think, when time goes on, there will follow some more. -------------------------------------------------------------------------------------------------------------------- Hi, for those who don't know it already, we have started to build an ImageSizer replacement based on Imagick / ImageMagick. Its actual state is that we now have implemented a basic color management and optionally an ICC-based more accurate color management. Due to not finding much answers and informations on the net about that we have had some struggle to get it working on different ImageMagick versions. And even if it works on three or four versions that we can get hands on, we need more informations of supported versions. There for it would be really helpful that you test that feature on as many different servers you can and report back the result. To make that as easy as possible I have created a Siteprofile together with the latest PW-Devbranch and a brandnew ImageSizer.php. You can get it above in this post as ZIP. It has many images for different tests and it is more robust now. after installing the site profile, you need to install the Imagick Resizer in the admin under section modules the frontpage is a site with different image tests to run the tests you need to be logged in (in the backend) we are interested in the results of ImagickResizer test cms-with-icc_short if the first test looks successful (all text is green) you may go on and test ImagickResizer test cms-basic_visual and maybe ImagickResizer test cms-with-icc_visual At the end of the page you should see a summary like that: array(13) { ["test"] string(18) "cms-with-icc_short" ["hasUsedCMS"] string(3) "6/6" ["executiontime"] string(12) "5.9393400000" ["engine"] string(18) "Apache 2.0 Handler" ["php"] string(6) "5.4.26" ["os"] string(81) "Windows NT KAWOBI 6.1 build 7601 (Windows 7 Business Edition Service Pack 1) i586" ["imageMagick"] string(5) "6.8.8" ["imagick module version"] string(5) "3.1.2" ["imagick classes"] string(56) "Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator" ["ImageMagick version"] string(38) "ImageMagick 6.8.8-4 Q16 x86 2014-01-29" ["ImageMagick copyright"] string(46) "Copyright (C) 1999-2014 ImageMagick Studio LLC" ["ImageMagick release date"] string(10) "2014-01-29" ["ImageMagick number of supported formats"] string(3) "225" } Please first visually check if the images look ok or if they have strange issues (e.g. very much to brighten). Report if the images are ok and copy/paste that summary array here into the thread (please use the [<>] code button when pasting - for good readability!). Do that for the first test (cms-with-icc_short) regardless if it succeeds or failed! If you do not see a summary, there is a great chance that you are not logged in or that you have selected a different test than that we are interested in As a visual reference you can look here for the short_test, the test with icc and here for a basic test result. Note: Without icc-cms the cymk and gray images do not look good, but this is expected!
    3 points
  3. I'm actually glad that ProcessWire has a lot of this type of safety features. This particular one has saved me many times. Sometimes I'm very bull headed about things. Even with a warning I would have deleted a template (because of course I know what I'm doing). Whenever I get that error, I have to stop and think "Oh yeah, I forgot about that" and then to proceed to delete the template where it won't affect what I have spent hours working on. I can't speak for everyone, but sometimes I think I'm smarter than I am. The safety feature makes me smile because I know that ProcessWire is a development platform that protects me from myself. Maybe there could be an option to turn off some of these safety features for anyone else. I just hope that one doesn't change anytime soon. As stated earlier, some of these suggestions have merit.
    3 points
  4. This is unbelievable, I thought PW will do lowercase all image filenames on upload. But seriously: I might have updated the files in my installation just by copying them over, after they were installed from PW. And yes I'm on windows. But the CMYK and gray images are not what is expected after a ICC-profile conversion. I have to think about a better test that returns if all profiles needed for the conversion were found on a per image basis. PS: Adrian the bug hunter!
    2 points
  5. I had to rewrite some of the tutorial for adding a script in admin.php. Due to some effect of an installed third party module, the custom script was added after Jquery core js. This usually isn't the case when adding a script via admin.php. I wasn't aware of it at that time and only later remembered that adding a script the way I proposed in admin.php will add our script BEFORE the jquery core script in admin, thus not working when using $ jquery syntax. It's simply because of the order the JS's get added. After investigating, I found the third party module that was, for some reason, changing this behavior. Reason was: it was loading the JqueryCore in the init() method, thus resulting in my script getting added after JqueryCore. I've changed the tutorial to account for this simply by calling the JqueryCore module before adding the custom JS. So instead you would have to do it like this to make sure it gets added after JqueryCore js. $modules->get('JqueryCore'); $config->scripts->add($config->urls->templates . "scripts/scroll.js"); Sorry for the confusion.
    2 points
  6. Client: I can't login to the back-end ! We asked: What browser do you use ? Client: What do you say ? We asked: With which program you go on the internet? Client said: Mozzarella
    2 points
  7. What does autojoin do? Using the 'autojoin' optimization can increase performance on fields that get used a lot. Not using it can reduce the page's memory footprint. What is more desirable in each instance depends on your situation. What sites should use autojoin? Autojoin is most applicable with larger sites. On smaller sites, there may be no benefit to using it or not using it. But it's good to know what it's for regardless. Where do you control autojoin? Autojoin is controlled per-field. You can turn it on by editing each field under Setup > Fields > [your field], and you'll see it under the 'Advanced' heading. When should you use autojoin? Autojoin causes the field's data to be loaded automatically with the page, whether you use it or not. This is an optimization for fields that you know will be used most of the time. Fields having their data loaded with the page can increase performance because ProcessWire grabs that data in the same query that it grabs the Page. Autojoin is a benefit for fields that are always used with the Page. This is best explained by an example. Lets say that you have a template for individual news stories called news_story. The news_story template has these fields: title date summary body sidebar We'll assume that when you view a page using the news_story template, all of the fields above are displayed. Fields that should have autojoin ON: Now consider a separate news_index template that displays ALL of the news stories together and links to them. But it only displays these fields from each news story: title* date summary In this case, the 3 fields above would be good to autojoin since they are used on both the news_index and news_story templates. If your title, date and summary fields didn't have autojoin turned on, then ProcessWire wouldn't go retrieve the value from the database until you asked for it it (via $page->summary, for example). Because the news_index template displays all the stories at once, and always uses the title, date and summary fields, it will perform better with title, date and summary having autojoin ON than with it OFF. In this case, it reduces the query load of the news_index template by 3 for each news story. To take that further, if it were displaying 20 news stories, that would mean 60 fewer queries, which could be significant. Fields that should have autojoin OFF: Now lets consider the body and sidebar fields, which are only used on the news_story template: body sidebar It would be desirable to leave autojoin OFF on those fields because there is no reason for the body and sidebar to be taking up space in memory when they are never used on the news_index template. While it might mean 2 fewer queries to view a news story, that is not significant and certainly not a worthwhile tradeoff for the increased memory footprint on the news_index template. Keeping autojoin OFF reduces a page's memory footprint. Conclusion Using the 'autojoin' optimization can increase performance on fields that get used a lot. Not using it can reduce the page's memory footprint. What is more desirable in each instance depends on your situation. But if your situation doesn't involve lots of pages or data, then you don't need to consider autojoin at all (and can generally just leave it off). Additional Notes Not all fields have autojoin capability. You won't see the option listed on fields that don't have the capability. *The title field has autojoin on by default, so you don't need to consider that one. It was included in the examples above because I thought it's omission might cause more confusion than it's inclusion. Be careful with multi-value fields that offer autojoin capability (page references and images, for example). Because MySQL limits the combined length of multiple values returned from a group in 1 query, autojoin will fail on multi-value fields that contain lots of values (combined length exceeding 1024 characters). If you experience strange behavior from a multi-value field that has autojoin ON, turn it OFF. If you want to play it safe, then don't use autojoin on multi-value fields like page references and images.
    1 point
  8. I found the parseTags() routine from Ryan's Login Notify plugin pretty useful in a couple of modules I wrote recently and will probably reuse it again in other modules. I thought others might find it useful too, especially if it were slightly more flexible in the setup of the context from which it pulled the values to use in its substitutions so I rewrote it as a Textformatter. Originally parseTags() would turn something like this... "Date: {datetime}\nUser: {name}\nIP: {REMOTE_ADDR}" …into something like this… Date: 12th September 2012, 14:45 User: ryan IP: 127.0.0.1 ...using a User as the context for the substitutions. This text formatter extends this to allow an array of WireData instances to be used as the context for substitutions and extends the tag format from simply {fieldname} to {context.fieldname} to allow substitutions from specific places. This could allow you to use data from, say, a User and a Page when parsing your string. Something more complex can then be parsed successfully; like this... Hello {user.name}, where have you been? It's {datetime} now and we haven't seen you in two weeks. Your last edit was on page '{page.name}' from address {REMOTE_ADDR} ...where the name field from both the supplied User and Page can be substituted into the text. It's entered in the modules directory here but most of the documentation is in the readme file on github. There is also a handy Process module that allows you to experiment with it from within the PW admin (thanks to Nik for the idea as it's based on his Test Selectors module.)
    1 point
  9. Install Process Why not try to create a database automatically if it does not exist? When I entered HTTP Host Names and the DB Auth failed, I had to enter this information again. Please do not delete data in input fields if something was entered incorrectly. Adding fields When I add a field, I want to add it directly to one or more templates. This is solved very cumbersome. It would be better if I get a list of all templates and select in which templates the field should be added. Deleting fields "This field can not be deleted because it is used by one or more template ( s ) ." It should be displayed, in which templates the field is used. New Option: Force delete field There should be an option to force delete a field. "The field $fieldname is going to be removed from the following templates a b c Are you sure to delete it? (yes)(no)" New Option: Force delete template This Template is used by 3 pages: Page 1 Page 2 Page 3 Are you sure to delete it? (yes)(no)" What should happen with pages that have this template currently assigned after removal? ( ) Delete them too (X) Assign a new template Creating new templates When i created a new template with template->new from the dropdown-menu i don´t want to get back to the overview page for templates. I want to edit my newly created template directly. So please redirect to the edit page instead. This is a different behavior to adding fields, which works as intended. What was that fieldname again? Please show the name of the field after the label if debug mode is on (or always?) Easier select field The option/label should be only divided by = If no label is assigned, display the option as label What do you think of these improvements?
    1 point
  10. My client of the day is a chap for whom I did a couple of banners to run when Double Click was very first launched - 1996? Something like that. It seems he never got round to using them until now but cannot find the CD. He would apreciate it is I could run a new copy for him - he is not prepared to pay. NO I BLOODY WELL CANT! ------------------------------------- Please feel free to post YOUR client of the day.....
    1 point
  11. I knew that I forgot something^^ That´s the problem with my idea, I´m not a programmer myself. I´m happy that I can get some loops working I could help with the CSS hehe Offtopic: Gerade gesehen, dass du aus Aachen bist Horst, ich komme ursprünglich aus Berlin ;-)
    1 point
  12. Hi Can, welcome to the forums. this looks interesting. It is a good compromise between the need of using images in a RTE and have some control over the output. BTW: Are you able to code something like this, I mean the JS stuff that is needed?
    1 point
  13. It was an issue with the case of image filenames. In your zip you had: colortarget_sRGB_8bit.jpg but it was looking for colortarget_srgb_8bit.jpg Are you on a windows server, or something else that doesn't check filename case?
    1 point
  14. @Raymond: If you read this, Can you please apply the patch Horst provided. Shit ! Read your message to late Horst. I successfully installed Imagic. For other users using the same setup as I do (Raymond, Arjen) I confirm that ImageMagick installer for Mac OS X is working. Big thanks to cactuslab! Sorry guys... Some how I thought this was working.. it doesn't..
    1 point
  15. On my machine Imagic Class is not loaded. This is on PHP Version 5.5.8. Darwin Czech-iMac.local 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64 Error: Class 'Imagick' not found (line 140 of /Users/martijn/Sites/domains/imagick/htdocs/site/modules/ImagickResizer/ImagickResizer.module) I can try to install Imagic as here is a how to do (never done this before) and I hope I will not screw it.
    1 point
  16. Hey guys, like PW a lot, thanks for that. Especially to Ryan ;-) At the moment I´m thinking about how to set up some sites. Then I came across this thread and actually here are some nice suggestions and ideas! The safest way is of course to not let the customers use images in wysiwyg fields and handle it via template output. But sometimes it´s just better to have images in RTE. Like the shortcode way, but as some others, I think it´s still to codey. I made a little mockup to illustrate my thinking What do you guys think about something like this: You have a thumbnail image field set up with some sizes After uploading a couple of images you get a view like in the attachment (it´s a bit messy I know..) Then you can just drag an image or grab directly a cropped one (just grab the name of the size) into the RTE The image is showing in the wysiwyg in the expected size It´s showing some controllers to set alignment and change size if needed First I thought about a little gear on the image, similar to Wordpress (?) but with a little dropdown for those settings. Okay it´s possible to show the dropdown on hover of course but it´s an extra way to get there and open it. But of course there is a lot of space to beautify this idea. And to limit the errors it´s only possible to adjust the image to the given sizes, so the designer is able to calculate any possibilities. Cheers, Can
    1 point
  17. OK, cms-basic-visual array(12) { ["hasUsedCMS"] string(1) "0" ["executiontime"] string(12) "2.3945900000" ["engine"] string(18) "Apache 2.0 Handler" ["php"] string(6) "5.4.27" ["os"] string(71) "Linux 2.6.32-5-amd64 #1 SMP Mon Sep 23 22:14:43 UTC 2013 x86_64" ["imageMagick"] string(5) "6.6.7" ["imagick module version"] string(5) "3.1.2" ["imagick classes"] string(56) "Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator" ["ImageMagick version"] string(34) "ImageMagick 6.6.7-5 2011-02-05 Q16" ["ImageMagick copyright"] string(46) "Copyright (C) 1999-2011 ImageMagick Studio LLC" ["ImageMagick release date"] string(10) "2011-02-05" ["ImageMagick number of supported formats"] string(3) "194" } cms-with-icc-visual array(12) { ["hasUsedCMS"] string(1) "1" ["executiontime"] string(12) "2.4738700000" ["engine"] string(18) "Apache 2.0 Handler" ["php"] string(6) "5.4.27" ["os"] string(71) "Linux web 2.6.32-5-amd64 #1 SMP Mon Sep 23 22:14:43 UTC 2013 x86_64" ["imageMagick"] string(5) "6.6.7" ["imagick module version"] string(5) "3.1.2" ["imagick classes"] string(56) "Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator" ["ImageMagick version"] string(34) "ImageMagick 6.6.7-5 2011-02-05 Q16" ["ImageMagick copyright"] string(46) "Copyright (C) 1999-2011 ImageMagick Studio LLC" ["ImageMagick release date"] string(10) "2011-02-05" ["ImageMagick number of supported formats"] string(3) "194" }
    1 point
  18. Yeah, it was the path to those _phpcls classes. I am testing locally and it seems like there was an issue with $_SERVER['DOCUMENT_ROOT']. Once I hardcoded this, the install works fine. So maybe just an issue for me and no-one else will be affected.
    1 point
  19. Very cool Horst, I'll see if I can find a gap within the next days...
    1 point
  20. Hi John, you have to additionally grant edit access to the templates you're allowing your customer to edit. To do this go to Setup › Templates › (some_template) › Access › Click Yes and then in this row give the new role all intended permissions.
    1 point
  21. Our mother company is large company which deals with hosting and domainname registration. They generate most of our revenue through online checkout. There are people who don't understand the process and the chat helps them a lot by giving (pro-active) advice and information. But you have to have a dedicated team trained in assisting and chatting with people. I often hear these requests from small companies with one or two employees. Chatting isn't an option for them because who is going to man the chattingchair? It also may depend on targetaudience, culture and other variables. I see a lot of small webshops where the chat is always offline.
    1 point
  22. Why wouldn't you be able to store it in the database though? A database still exists on a disk so your only limitation is disk space and server power (assuming lots of pages means lots of visitors). It would be more worthwhile looking into caching options instead I think. Something like the ProCache module (see the Store link at the top of the forums) caches your pages as static HTML so the database doesn't get queried for users who aren't logged in and is a relatively simple but really massive speed boost whilst taking a lot of load off the server (neither PHP or mySQL get touched for ProCached pages). If you have some really complicated page templates, ie. lots of fields in an invoices template that will have hundreds of thousands to millions of rows etc, then it can be worthwhile building a fieldtype specificaly for it so that it acts like a normal table and all the fields are in the one table in the database (less queries to join all the data). I would definitely investigate other options first, but always remember that a database exists on a disk so is theoretically only limited by hardware if your queries are built well. What size site do you have that is causing you to ask about this anyway, if you don't mind me asking?
    1 point
  23. Well that shows it's running Apache. Looking at the path of that error it shows the server is running php under suPHP and if you google that error you are getting, it seems that everyone is also running suPHP, so I think it might be time to put the onus back on your host. Maybe someone else has some better ideas? PS I had to deal with crazydomains once - I found the site was often unavailable for a few minutes at a time, quite regularly. I know you can't change, but I am sure they are the issue.
    1 point
  24. General rule of thumb in marketing is "never disappoint." If you cannot man support or sales 24/7, don't add something that looks like you can and then "dissapoint" by asking people to leave a message. That is very much a techy sort of solution, rather than addressing the realities of human communications. In this situation you need to offer a form of communication that fits with the company size. So, perhaps, a nice pop up contact form from the bottom of the browser that says "Please leave a detailed message and we will respond to you fully during our business hours. If you need to talk to us in detail, leave a phone number and we will be happy to call you. Let us know a time that would suit you best." The most important thing when communicating is not so much that you will communicate at any time, but rather that you will be very HAPPY to communicate and answer all questions IN DETAIL. That sounds like you care about your custom and treats it seriously. You score far better points with that than with trying to sound immediate and awake at all hours. Think of a good old fashioned shop. Would you rather a shop that was open 24 hours fronted with meaningless personnel who wait for you to choose then just take your money, or would you rather wait till a shop opened but was manned by someone who smiled and then tried to fund out exactly what you need?
    1 point
  25. If you need to handle a large quantity of pages, I'd probably rely on SQL. Sounds like a rather trivial task that way, though this, of course, depends on what you're actually after. If I'm reading your post correctly and it's just selected pages you're looking for: SELECT GROUP_CONCAT(data SEPARATOR '|') data FROM (SELECT DISTINCT data FROM field_myfield ORDER BY data LIMIT 5) f; After that you've got a list of pages you can pass to $pages->find().. though I don't quite understand why you'd want to do this with the limit, so there's probably something I'm misinterpreting here. I hope you get the point here anyway IMHO It's questionable whether selectors even should be able to handle every imaginable task. This, for an example, seems quite rare need to me (and is already easily solved by either loop or SQL). Selectors are good at finding pages in general, while finding distinct values, even when those values are later used for finding other pages, sounds like a job for something entirely different -- or some kind of combination of SQL and selectors.
    1 point
  26. If you don't get to the root of your problem it will come back to you later on. I do expect the same problems for the back-end and recreation of the cache, so I think ProCache on it's own is not a solution. Nevertheless, those $39.00 spend for ProCache will be the best $39.00 spend this week I think. Sorry I can't help you more then this.
    1 point
  27. Here's a few things to play with - I am a relatively new Mac guy too and the first few keep me sane http://binarynights.com/forklift/ and/or http://www.trankynam.com/xtrafinder/ if you can't stand folders mixed in with files alphabetically) http://hyperdock.bahoom.de/ http://stclairsoft.com/DefaultFolderX/ http://www.alfredapp.com/ http://justgetflux.com/ http://jumpcut.sourceforge.net/ (might be a newer alternative, but I use this all day long) http://www.mirovideoconverter.com/ (not Mac specific, but so convenient and easy) http://www.boastr.net/ http://www.vienna-rss.org/
    1 point
  28. Assuming that those time entries alway have a start and an end. And as the date is not necessary I assume that those time stamps never overlap the span of 24 hours. I do think it's not that difficult to "rebuild" Soma's slider a bit. Set it to RangeSlider and set the Max value to 86400 (seconds a day). or to 96 ( all quarter of hours a day ) Then the only thing you need to change is the value for the slider labels.
    1 point
  29. Argh screw it include=all has it all...
    1 point
  30. Hey SteveB, Hey Manaus, as Marco can't answer currently I'll try to answer your questions as far as I can. @SteveB the answer is: No. As you've mentioned you can't just use PHP in Template Twig Replace. It is designed to replace the whole rendering Process and expects the input to be twig compatible. You could use Twig filters to achieve PHP execution though. The way we (Marco works at the same company I do) use Twig Replace & Data Providers is somewhat similar to the delegate approach. We use some basic "wrapper" Templates and extend them (using blocks) with template based code. Here is an example we actually use in a blog page from an actual project: Base Template (_base_template.twig in /templates) which is extended later on (every %block acts as a placeholder which can be filled with stuff from templates or chunks): <!DOCTYPE html> <!--[if lt IE 9 ]><html class="no-js lt-ie9" lang="de"><![endif]--> <!--[if IE 9 ]><html class="no-js ie9" lang="de"><![endif]--> <!--[if !(IE)]><!--><html class="no-js modern" lang="de"><!--<![endif]--> <html lang="de" xmlns:fb="http://ogp.me/ns/fb#"> <head> {% include 'includes/htmlhead.twig' %} {% block htmlhead %} {% endblock htmlhead %} </head> <body> <div class="wrapper"> {% include 'includes/header.twig' %} {% block stage %}{% endblock stage %} <main class="main"> {% block mainContent %}{% endblock mainContent %} </main> {% include 'includes/footer.twig' %} </div> {% include 'includes/javascript.twig' %} {% block beforebody %} {% endblock beforebody %} </body> </html> Blog Page (blog.twig in /templates) which displays an overview of the last articles: {% extends '_base-template.twig' %} {% block stage %} <div class="stage row"> <img class="stage__background" src="{{ config.urls.root }}dummy-data/stage_default.jpg"> <div class="stage__inner large-12 large-offset-2 columns"> <h1 class="stage__headline stage__headline--default headline">xxx</h1> </div> </div> {% endblock %} {% block mainContent %} <main class="article row" role="main"> <div class="large-offset-2 large-10 columns"> {% for article in articles %} {{ page.renderChunk('includes/blogpost_preview.twig',article,'blog') }} {% endfor %} {{ page.renderChunk('includes/pager.twig',articles) }} </div> {% include 'includes/sidebar.twig' %} </main> {% endblock mainContent%} The Coressponding "DataProvider"/Controller (BlogPage.php in /templates/dataproviders): <?php /** * Class definition of BlogPage * * @version 1.0.2 * @copyright Copyright (c) 2013, neuwaerts GmbH * @filesource */ /** * Class BlogPage */ class BlogPage extends \nw\DataProviders\PageDataProvider { public function populate() { // load articles $today = date('Y-m-d'); $this->articles = wire('pages')->find('template=blog_article, blog_articledate<=' . $today . ', sort=-date, limit=5'); $pages = wire('pages'); $this->categories = $pages->get('/blog/kategorien/')->children(); $this->authors = $pages->get('/blog/autoren/')->children(); } } And (just to make it complete and show some more twig stuff) here is the chunk for displaying the blog post previews that is included in the template. The chunk gets the article as a param and has it's own controller where you can place logic (i.e. to find related articles), too. <article class="article__preview clearfix"> <div class="article__content"> <header class="article__header clearfix"> <h2 class="article__headline"><a href="{{article.url}}">{{ article.headline ?: article.title }}</a></h2> <div class="article__meta"> {% for author in article.blog_author %} {% if loop.length > 1 %} <span class="meta__author"><img class="article__avatar" src="{{ author.blog_authorimage.size(20,20).url }}" alt="{{ author }}">{{ author.title }}</span>, {% endif %} {% if loop.last %} <span class="meta__author"><img class="article__avatar" src="{{ author.blog_authorimage.size(20,20).url }}" alt="{{ author }}">{{ author.title }}</span> {% endif %} {% endfor %} | <time datetime="{{ article.blog_articledate|date('Y-d-m', config.timezone) }} ">{{ article.blog_articledate|date('d. F Y', config.timezone) }}</time> </div> </header> {% if includeTemplate == 'blog' %} {% if article.blog_keyvisualsize == 'small' %} {% set size = 280 %} {% else %} {% set size = 755 %} {% endif %} {% if article.blog_articlekeyvisual %}<img src="{{article.blog_articlekeyvisual.width(size).url}}" alt="{{article.blog_articlekeyvisual.description}}" class="article__keyvisual {{article.blog_keyvisualsize}}">{% endif %} <div class="article__text"> {% if article.body|length > 350 %} {{ article.body[:350] }}... {% else %} {{ article.body }} {% endif %} </div> {% endif %} <div class="article__category"> {% for category in article.blog_category %} {% if loop.length > 1 %} {{ category.title }}, {% endif %} {% if loop.last %} <a class="category__link" href="{{ config.urls.root }}blog/kategorien/{{category.name}}">{{ category.title }}</a> {% endif %} {% endfor %} <div class="article__read-more right"> <a class="read-more" href="{{article.url}}">Artikel lesen</a> </div> </div> </div> </article> So we're basically splitting everything in includes (DRY), template specific stuff and Controllers. That's the way we believe is the "cleanest" and best maintainable. If you'd like to output some default stuff (i.e. headline and body) you're free to add it to the base template and just overwrite the block that they are in on demand. @Manaus: You don't HAVE to rename everything into .twig - but you CAN. If you like to do this you'll have to set this explicitly in site/config.php: $config->templateExtension = 'twig'; Enclosing everything in a <?php is not required (in fact it will output this as plaintext: <?php).
    1 point
  31. This is the nature of how the ajax uploading works, as it triggers a page save (though saving only the field you upload to). One way we could solve it is to add a status field to the file/image fieldtypes, giving them a way to identify a file as unpublished. Not sure how simple it will be to implement, but this is one of the things I've had on my list for awhile. If it comes up more often, I'll definitely bump it higher up the priority list.
    1 point
  32. Actually $modules->get("MarkupBox") will install the module if it's not
    1 point
  33. You're very close actually . This is how it works: if($modules->isInstalled("MarkupBox")) { // do something }
    1 point
  34. Nice job Khan! Perhaps we should integrate this as an option into the main Comments fieldtype? Or should be be a separate fieldtype (under a different name)?
    1 point
  35. The behavior is intentional. Any time a page is saved (whether just a field from it or the whole thing), the modified date is updated. There isn't currently a way to bypass that. Though if there's demand for it, I'm sure we could find a way. I'm going to marinate on the idea a bit to see if there are any simple solutions that I'm not thinking of yet. But one question would be why wouldn't you want the modified date updated? (preference to only show admin modifications?) I'm just wondering about the broader context, to get a sense of the situations where one would want this disabled.
    1 point
×
×
  • Create New...