Jump to content
geedamed

Page in non-default language only - can it be done without separate trees?

Recommended Posts

Hello everyone :-*,

I searched the forums, but could not find any simple way to take the default language out of one page (or a few pages), like this

Homepage

    en

        page1

        page2

    de

        seite1 (page1 content translated in German)

        seite2 (page2 content translated in German)

        seite4 (only in German, no English version - this is what I don't know to do)

The way it is now, the default language cannot be disabled, so "seite4" would have the English translation fields in the editing form and would render in the front end.

I thought about creating a second English (en) language and hiding the default one, but it won't work because the way ProcessWire treats the "name" field.

Another way would be separate trees for each language. That would work for languages with content that is different enough. But for one or a few pages that would not be translated to the default language, I would loose the integrated interface and big image would become more difficult to see. So I'd much prefer not to use it.

The last way that crossed my mind was to modify the LanguageSupportPageNames module to update behind the curtain the default language with something while keeping it hidden. That's probably what I'll try given enough time.

What do you say? What do I miss?

 

LATER EDIT: I totally don't know any German, used it just as an example.

Share this post


Link to post
Share on other sites

Hi, probably I'm missing something about your request...

Quote

...would have the English translation fields in the editing form and would render in the front end.

Why should it render in the front end if there are no filled (english) fields? You could just check if a field is empty or not.

By the way, check out this module by @adrian, it could be useful in your situation:

https://processwire.com/talk/topic/14891-restrict-multi-language-branch/

Share this post


Link to post
Share on other sites

My bad, i should've not added that render comment. Sure, I could check the fields to see if they are empty and a 404 is needed. The other languages don't need this check, though. They can be disabled and that's enough.

My real question is about the editing interface: how can I hide the default language fields?

Thanks for the link to Adrian's module. Unfortunately, as I said in the first post, I'd very much prefer not to separate the translation interface for all pages just because a few of them might not use a language. Also, it appears that the request Adrian made for hooking the Languages class remained unanswered and so, his module cannot currently select the supported languages - it's all or default only.

IMO, the dificulty springs from the fact that the "name" and "title" mandatory fields are being used as translations. I'd rather duplicate "default" as  English and treat "name" as an ID, but then again, Ryan knows much better than me.

Share this post


Link to post
Share on other sites

Ad far as Il know it's not natively possibile to hide the default language fields from the backend, but you can can leave them empty and check (inside a foreach loop or whatever) if a default field of your choice in empty and then not render that page at all (a 404 would be invoked only if a user is going to switch the language on that particular pages, but you could instead redirect them, let's say, to the homepage.

Probably not what you asked exactly but nothing else comes into my mind right now:)

Share this post


Link to post
Share on other sites

If it was me editing the pages, I could live with it, but for regular users is confusing. Not to mention paying customers :lol:.

  • Like 2

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.

×
×
  • Create New...