-
Posts
4,632 -
Joined
-
Last visited
-
Days Won
55
Everything posted by apeisa
-
How do I work with the NullPage with $page->prev and $page->next?
apeisa replied to ljones's topic in General Support
Added <?php to your code example. I have not used prev and next, but this should work: <?php if ($page->prev->id) { echo "prevlink here"; } There is this note in documents to be aware of: But if you want to do a full circle, I assume that you don't have too many pages. To make a circle, this could work: <?php if ($page->next->id) { echo "nextlink"; } else { $firstpage = $page->siblings->first(); echo "<a href='$firstpage->url'>$firstpage->title</a>"; } -
I have had the exactly same thought when using this and I will probably implement that when first client project comes which requires this. Or actually I was thinking about making it work with specific fields, but that template option seems to be even better. Thanks for the suggestion!
-
5% is definitely big chunk of overall users. So I wouldn't release a site that doesn't work well on IE7, at least if audience is not it-orientated. But for admin site it requires very specific case (like I think Soma has now) to add support. Btw Soma, have you discussed about Chrome Frame: http://code.google.com/chrome/chromeframe/ It installs without admin rights to IE 6/7/8 and should work with PW admin without any problems (may require one meta tag). Also would add support for drag and drop uploads.
-
I wouldn't bother at this point: http://thenextweb.com/microsoft/2011/12/15/microsoft-to-launch-auto-updates-for-internet-explorer/ Of course if there is organisation which IT-admin exclusively disallows update, then it wouldn't update to IE8/9. Then I would think about supporting IE7, especially if the project is big enough. Little OT: Currently most our clients visitors have about 5% IE7 usage. I am very interested to see that statistic after few months to see how that auto update affected.
-
Progress on ProcessWire 2.2 and overview of multi-language support
apeisa replied to ryan's topic in Multi-Language Support
Actually forget to mention this earlier - it seems that quests don't see the default language, they see always __("Original tags"). Not sure if this is already fixed, since that was few iterations ago... -
Nice drive you have Nico! I can see your need for this module, but I personally would try to keep urls in sync with page tree. Part of the pw simplicity comes from pagetree and url sync, when compared to bucket based systems like ee and Drupal. But if the need comes to have different url schema, I will definitely use this.
-
Not sure if I understand your need correctly, but it might be that all you need is modal=1 on your url. That way admin templates strip everything.
-
Sounds good Nikola!
-
Just tried this. My only gripe is that "Sidebar" button - it is most visible element on theme and it is just for visual purpose. I think it will get annoying very soon. I do like the visuals there (red color etc). Maybe you could use that style on search form? Drop the Search heading and just style the search form like you have Sidebar at the moment. I think that would be great. Other than that - very well build and nice theme!
-
Looks great Nikola, can't wait to test this one.
-
Great work Nico. It is superb design! Looking forward for mobile version.
-
Great stuff Jasper. If you have something else how you can figure when that str_replace is needed, then you could just if based on that. Probably little bit easier to maintain than separate template just for that. But I don't think that simple str_replace is causing any problems for your site performance. Not sure though.
-
I went ahead and tested this problem with other site Nico posted here (http://schiller.nico-knoll.de/de/), where was this similar issue (content clipped on small resolution). There changing from this centering method to more normal fixed everything - actually only thing needed was taking few css rules away (see screenshot). But in stadtpirat there is also this absolute positioning stuff, which causes problems. If you resize your window and look at the firebug/web inspector at the same time, you can see how it changes those inline values. After you have small enough screen it will position them out of the screen: position: absolute; left: -30px; etc... Nico: are you using some kind of js-plugin for the layout? Is there some way to make it work with smaller screens also?
-
Soma: I re-read the original post and don't know how I understood it that way (that you are against negative margins), sorry about that. Yeah, that overall combination is strange and messy - I think 99% of times just margin: 0 auto; does the same with much more reliable manner. But unfortunately that won't help here, fixing this issue probably requires more work than that.
-
But that is also pretty strange way to center position in that case. Margin: 0 auto; would do the job just fine. I tested in web inspector to remove those styles from #home and set it to margin: 0 auto; It centered fine, but didn't resolve the main problem (hidden content on small screen). So that is not the issue.
-
Well, content is not inside that #home element, so I don't believe that is the main issue. It might be that it causes similar effect there (not sure), but the main issue comes surely from absolute positioning on everything. Negative margins are part of the spec, they are well supported and work as expected. Also spec is pretty clear how they should function: http://www.w3.org/TR/CSS2/box.html (search: "case of negative margins"). They are not evil Soma . I have never seen similar problems with any negative margin layouts... Ie. these here: http://www.alistapart.com/articles/negativemargins Although I don't prefer using negative margins myself. I use them only when necessary (and that means I don't have easy access to markup) which is very rare.
-
Nico, not sure if you are aware of this, but your blog is almost un-usable on Android Browser (at least default one that comes with HTC Desire HD). It crops half of the left content out, no matter which page you are. When reading single post you can only see few words at the end of the lines. This is probably caused because everything is absolute positioned (that is some wild stuff you have there ). So there is no any kind of content flow. You can test this if you resize your browser window to smaller size: you cannot scroll to the left, even when content doesn't fit into the window. Wouldn't it be much simpler layout to have three columns and let the content flow without any absolute positioning?
-
I would actually build simple module in your first question: $modules->MarkupCurrencies->getCurrency("SEK");
-
Your question number 2. is well covered with this RSS Feed Loader -module by Ryan: http://processwire.com/talk/index.php/topic,503.0.html Your first question... I think there are million ways to go, but first thing that got into my mind would be something like this: use some simple "tag" in your bodytext. Let's say it would be like this: {CUR=SEK} Then you would parse your bodyfield before outputting it, looking for {CUR=} tags. I think best way here would be regexp which looks for words which starts with { and end with } and have 7 chars between (you could check for = char also just in case). I'm not very good with regexp, so I leave that part for you It shouldn't be hard though. Then you would have php script which does the actual XML parsing. This can be actually PW template and page if you want to. It could be hidden page like /currencies/ and template would be something like this: <?php // Written in browser, no error checking etc... // Should output rate for desired currency $cur = $input->get->cur; $url = "http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml"; $xml = simplexml_load_string(file_get_contents($url)); // This is most probably not right, written in browser and haven't used simpleXML in ages.. $value = $xml->xpath("gesmes:Envelope/Cube/Cube/Cube[@currency=$cur]")->attributes()->rate; echo $value; And back to your actual template. When you parse and find {CUR=} tags, then you will do something like this in your template: <?php $tag = "{CUR=SEK}"; // This (or these if multiple required?) comes from regexp $cur = "SEK"; //this actually comes from {CUR=SEK} $value = get_file_contents("/currencies?cur=$cur"); $output = "The current currency rate: 100 Swedish Crowns is $value Euro"; $page->body = str_replace($tag, $output, $page->body); Here I would use MarkupCache -module so that it wouldn't hit other server on each page load, only once a day or each hour or so. Sorry if this came out little messy, written in rush, but hopely it will help you forward. Also - I am not sure if this is most elegant way to solve this (just first thing that came into my mind), so others please dive in with other solutions too.
-
I am pretty sure you only need inputfield at the moment. Unless you need different db schema, or different way to save and retrieve data from db you will be fine with normal textfield. Please correct my Ryan if I am telling lies here Not sure where you are heading with this, so it might be more convenient for you to keep it this way. Anyways, looking forward to using this - looks like a very useful module. Not sure if I would like to use this with tags, since I like my page references there (they allow easy renaming, removing etc if ever needed).
-
Looks great Nico! One question : does the fieldtype difference somehow from normal textfield? Just thinking if inputfield would be only thing required. Anyway, based on the screenshot this looks like a very useful module.
-
I cannot promise to stay away from computer whole holidays, so count me in Merry Christmas everyone!
-
I didn't export that CSV from anywhere - I just wrote that myself as test case. I wasn't sure should the content be escaped so tested it without escaping - I was little bit surprised with the result (it worked, sorta)