Jump to content
desgnl

Simple multilingual portfolio

Recommended Posts

Hello processwire users 

i am new here. I used to do my sites with wordpress, but i read many good things about processwire and i would like to give it a try on a small project. I'd like to do a simple multilingual portfolio with a blog.

I read a few tutorials and watch a few videos already. From what i understand there are many ways of using processwire to achieve this project. I would like to explain the website details so you could indicate me the right way to do it and the good modules to use. 

I already did the html / css / js for the front end. 

it is in 3 languages : english (en), spanish (es), french (fr)

it uses 2 templates : project list, project page. 

1. the project page contains the following informations : 

  • title
  • description text
  • date 
  • category
  • tags
  • photos (not translated)
  • embeded content from the web (same for every language)

the blog posts behave like projects posts. One category would just be named "blog". 

the url are like this : www.urlofthesite.com/language_code/date/project

2. the project list is used for homepage, categories page, tags pages

the url are like this :

homepage : www.urlofthesite.com/language_code/

www.urlofthesite.com/language_code/category_name/

www.urlofthesite.com/language_code/tag_name/

translations

all the fields are translated except photos and medias. 

i would like to be able to translate tags and categories from one place and then assign them once to a project (and not re-type them in every translations) 

I would appreciate any advice or more about the best way to do a project like this.

especially concerning the modules to use and the way to handle the translations. 

thank you 

Share this post


Link to post
Share on other sites

Not sure if this will be the best idea ever (just getting started with PW too), but maybe you can simply add a "Page" field to the project template (single page selection will do just fine)? If a page is selected, just replace any empty field on the current page with the selected page's field. This way you can decide per page what you want to translate and what can be taken from the original page.

Share this post


Link to post
Share on other sites

I don't build a lot of multi-language sites, so some others here may have better suggestions than me. But in your case I would probably build separate trees for each language. Then have some code at the top of your shared template file that sets the language consistent with the branch:

if($page->rootParent->name == 'en') $user->language = $languages->get('en'); 
  else if($page->rootParent->name == 'es') $user->language = $languages->get('es');
  else if($page->rootParent->name == 'fr') $user->language = $languages->get('fr');

or better yet, if we can assume your language names and rootParent names will be the same, you could do this:

$language = $languages->get($page->rootParent->name); 
if($language->id) $user->language = $language; 

For your categories, you would want to use a Page reference field. Add a text field to the category template that uses the TextLanguage field type. (You'll have to install the LanguageSupportFields module for this). Then every time you add a category, you'll have inputs for each of your languages. When the front-end of your site outputs this field, it'll pull from the correct language automatically. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By sam-vital
      Hi,
      So I am a complete beginner with PW, just finishing up my first site, and I need to get my site online to do some final testing. Got all the FTP stuff sorted and I'm getting a internal server error when access my domain.
      I transferred over all files from processwire-master, and even when I am on local host I get sent to the index of my site, where I then click on processwire-master to be taken to my site.
      Where did I go wrong?
      Thanks!
    • By FrancisChung
      Does anyone here a personal portfolio site or a personal website that I can draw some inspiration from?
      I need to knock one up with minimal effort.
      I was wondering if there's any commercially available themes or solutions I can leverage?
      I looked at something called Gitshowcase but it didn't quite output what I needed, as it seems to have a very limited biography section.
       
    • By jploch
      I just relaunched my portfolio website. It's my first ajax driven website using ProcessWire as a CMS.
      Its a showcase of some of my work as well as a digital playground to improve my coding skills.

      If you encounter any bugs or have feedback, feel free to share  

      janploch.de
    • By benbyf
      http://www.karenthomasphotography.com/
      modules: AIOM+, ProcessPageDelete, TextformatterVideoEmbed.
      js: isotope, imagesloaded, fitvids, scrollTo, and Jquery with custom AJAX magic.

    • By benbyf
      http://carolineleeming.com/
      New website for still life photographer Caroline Leeming. Website build and design by myself - http://www.benbyford.com
      Using Jquery, alot of AJAX loading of content and the thumbnail grid with http://isotope.metafizzy.co/, slideshow hand coded by me.

×
×
  • Create New...