Jump to content

Samuel

Members
  • Posts

    24
  • Joined

  • Last visited

About Samuel

  • Birthday 07/16/1989

Profile Information

  • Gender
    Male
  • Location
    Munich, Germany
  • Interests
    Constantly creating ideas, passion for open source, design and technologie, interested in permaculture and in love with avocado and olive oil

Recent Profile Visitors

2,944 profile views

Samuel's Achievements

Jr. Member

Jr. Member (3/6)

7

Reputation

  1. I would like to create a language switch using Multi-language page names, but I have for each language a different domain. For example: domain.com instead of domain.com/en/ domain.de instead of domain.com/de I was finding various approaches and explanations, outdated and brand-new, but I think It would be great to gather everything in one place. So there are basically two questions: A) How to autodetect the browser language and redirect to the specific domain or default when not available. My approach would be to direct all domains to the default, in this case domain.com, and then let processwire redirect depending on the browserlanguage. B) How to create a manual switch with flags, to choose the language for the current page you are viewing, changing the path from: domain.com/about/ domain.de/ueber-uns/ Thanks a lot and I will update this post with the code we together brainstorm. Starting with connecting the domain to the language in processwire. <?php // Redirect to language fields of processwire if($config->httpHost == 'domain.de') { $user->language = $languages->get("deutsch"); } ?>
  2. That did it perfectly. Thanks! Therefore it would be interesting if it is possible to exclude the prepend and append template files from the config.php for specific pages like in this case, for rss pages.
  3. Heres what I get: Question: Is it possible to make the code collapsable, in order to make the post not so long? <!doctype html> <!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> <!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]--> <!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]--> <!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]--> <!--[if IE 9]> <html class="no-js ie9" lang="en"> <![endif]--> <!-- Consider adding an manifest.appcache: h5bp.com/d/Offline --> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" itemscope itemtype="http://schema.org/Product"> <!--<![endif]--> <head> <meta charset="utf-8"> <!-- Use the .htaccess and remove these lines to avoid edge case issues. More info: h5bp.com/b/378 --> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>rss</title> <meta name="description" content="" /> <meta name="generator" content="ProcssWire 2.3.0" /> <meta name="keywords" content="" /> <meta name="author" content="/livio/site/templates/humans.txt"> <link rel="icon" type="image/png" href="/livio/site/templates//img/favicon.png" /> <!-- Facebook Metadata /--> <meta property="fb:page_id" content="" /> <meta property="og:image" content="" /> <meta property="og:description" content=""/> <meta property="og:title" content=""/> <!-- Google+ Metadata /--> <meta itemprop="name" content=""> <meta itemprop="description" content=""> <meta itemprop="image" content=""> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> <!-- We highly recommend you use SASS and write your custom styles in sass/_custom.scss. However, there is a blank style.css in the css directory should you prefer --> <link rel="stylesheet" href="/livio/site/templates/css/gumby.css"> <!-- <link rel="stylesheet" href="css/style.css"> --> <link rel="stylesheet" href="/livio/site/templates/css/style.css"> <script src="/livio/site/templates/js/libs/modernizr-2.0.6.min.js"></script> </head> <body> <?xml version='1.0' encoding='utf-8' ?> <rss version='2.0'> <channel> <title>Latest updates</title> <link>http://localhost:8888/livio/rss/</link> <description>The most recent pages updated on my site</description> <pubDate>Thu, 18 Apr 2013 16:24:55 +0200</pubDate> <ttl>60</ttl> <item> <title>Sintel</title> <description><![CDATA[InfoPassepartout had a moist sensation about the eyes; his master's action touched his susceptible heart. Two first-class tickets for Paris having been speedily purchased, Mr. Fogg was crossing the station to the train, when he perceived his five friends of the Reform. "Well, gentlemen," said he, "I'm off, you see; and, if you will examine my passport when I get back, you will be able to judge whether I have accomplished the journey agreed upon." "Oh, that would be quite unnecessary, Mr. Fogg," said Ralph politely. "We will trust your word, as a gentleman of honour." "You do not forget when you are due in London again?" asked Stuart. "In eighty days; on Saturday, the 21st of December, 1872, at a quarter before nine p.m. Good-bye, gentlemen." Phileas Fogg and his servant seated themselves in a first-class carriage at twenty minutes before nine; five minutes later the whistle screamed, and the train slowly glided out of the station. The night was dark, and a fine, steady rain was falling. Phileas Fogg,]]></description> <pubDate>Wed, 03 Apr 2013 13:54:47 +0200</pubDate> <link>http://localhost:8888/livio/movies/sintel/</link> <guid>http://localhost:8888/livio/movies/sintel/</guid> </item> <item> <title>Big Buck Bunny</title> <description><![CDATA[]]></description> <pubDate>Thu, 04 Apr 2013 14:25:48 +0200</pubDate> <link>http://localhost:8888/livio/movies/big-buck-bunny/</link> <guid>http://localhost:8888/livio/movies/big-buck-bunny/</guid> </item> <item> <title>Tears of steel</title> <description><![CDATA[]]></description> <pubDate>Thu, 04 Apr 2013 15:41:36 +0200</pubDate> <link>http://localhost:8888/livio/movies/tears-of-steel/</link> <guid>http://localhost:8888/livio/movies/tears-of-steel/</guid> </item> </channel> </rss> <!-- JavaScript at the bottom for fast page loading --> <!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="/livio/site/templates/js/libs/jquery-1.7.2.min.js"><\/script>')</script> <script src="/livio/site/templates/js/libs/gumby.min.js"></script> <script src="/livio/site/templates/js/plugins.js"></script> <script src="/livio/site/templates/js/main.js"></script> <script src="/livio/site/templates/js/libs/jquery.easing.1.3.js"></script> </body> </html>
  4. Looks like a php error, but I really can't find it. Its exactly the code from above, without whitespace before the <?php opening tag and in my point of view there is no column 2 on line 1. What do you mean with the source of the RSS feed? My rss template file or something else?
  5. I am just trying to retrieve the rss feed and I am getting this error, when opening the page, with the template containing the following rss code. Where as "below" nothing appears. The Code: <?php // retrieve the RSS module $rss = $modules->get("MarkupRSS"); // configure the feed. see the actual module file for more optional config options. $rss->title = "Latest updates"; $rss->description = "The most recent pages updated on my site"; // find the pages you want to appear in the feed. // this can be any group of pages returned by $pages->find() or $page->children(), etc. $items = $pages->find("tags=short"); // send the output of the RSS feed, and you are done $rss->render($items); Any ideas, what I am doing wrong?
  6. Can you be more specific about what kind of website/project you are currently about to build? Processwire is too flexible, that you can simply decide for one way over another, since you can accomplish a project in a wide variety of approaches, Regarding your thinking about those 5% of different types of "posts" or the concern of how to display certain categories, you may have it easier, when differencing between how your "database of infos is structured" and the way you actually display the wanted data via templates.
  7. Sounds fascinating but I was of course referring more to cultural projects and their organizational aspects, that would hugely benefit, when implementing a git like version control system. For example, collaborative writing, tutorials & educational content, video-editing, open source hardware projects etc. Gaining productivity like a champ.
  8. Well I would like to .gitignore a file with the admin login credentials, to have a fully automatic gitbased workflow, from where I can push straight to the live/development site, including the mysql database. Have a look at this scenario: http://processwire.com/talk/topic/3229-version-control-for-mysql-via-git-hooks/
  9. You can use a git-based workflow and deploy to the live site with git-ftp: https://github.com/resmo/git-ftp The only thing I didn't figured out yet is how to automatically load the updated db afterwards into the live mysql database. For now I always update manually after pushing. And another interesting part would be to find a way to git ignore the admin credentials. But keep in mind, this kind of workflow only works for simple setups, since when your processwire project is getting more complex and the database is updating itself, because of comments, blog_post, new accounts etc. you don't want to mess with the live data. In that case better have an "pull" than "push" workflow.
  10. Can I set the adminuser and the password in the config.php as well?
  11. I found myself searching for an smooth workflow to collaboratively work on a process wire project and had the challenge of including the mysql data into version control to keep it in sync with the rest of process wire. Here is a solution with git hooks, that Ben Kubertis came up with: http://ben.kulbertis...-and-git-hooks/ Step 1: When commiting you want to fetch the latest changes of the database. Edit the "pre-commit.sample" hook located in /YourRepoDirectory/.git/hooks/ #!/bin/sh mysqldump -u [db_user] -p[db_password] --skip-extended-insert [db_name] > /PathToYourRepo/database.sql cd /PathToYourRepo/ git add database.sql Enter your mysql login details and git repository paths and then save and rename it to "pre-commit" That way each time you commit, any changes of the db will be downloaded and kept under version control Please note: If you only have modified the database and didn't touch any other files, you will have to manually pull the database updates, since git commit needs "changed files" to successfully commit. Step 2: When you checkout or merge branches, then you always want to fire up the belonging database again. Create another two hooks named "post-merge" and "post-checkout" with the following content: mysql -u [db_user] -p[db_password] [db_name] < /PathToYourRepo/database.sql NOTE: !!! Please test this first on a dummy project, in order to not mess your database up !!! When working with MAMP you probably have to add the path to mysql and mysqldump as well; Simply put /Applications/MAMP/Library/bin/ in front of it
  12. Good, I edited the first post. I think changing the title to "Distributed Version Control For Processwire" makes for the following conversation the most sense. And probably, if you want, delete comment #8 to #12 Thanks in advance, for cleaning up and sorry for the mess, I'll think more properly the next time!
  13. What do you think about "Distributed version control for content"?
  14. Thank you teppo that clarified a lot. I suggest, if there are any further ideas regarding different version, we continue in the other thread
  15. I would like to share with you the two projects that inspired my idea. prose.io | A well done and clean content editor for github substance.io | Distributed version control for collaborative writing projects. By the way; Is it possible to change the topic title?
×
×
  • Create New...