Django cms : how to get real page id - django-cms

I was using django cms 2.3.3 and everything was fine, and today I try to upgrade to 2.4.2
everything seems to be fine, just I can't understand why a page can have several page id, ie in admin, when I edit a page, i go for instance on /cms/page/2
but if I print it's id in menu with {{ child.id }} , the id is different, for instance 114.
Is it because I had to use shell command "cms moderator on"?
one more question, when I do any modification, I always have to validate "last changes" by clicking on green tick from admin list of pages. Is there a way to avoid that ?
thanks a lot

Starting with CMS 2.4, all changes made to a page or plugin need to be approved. This "moderation" system was introduced to allow users the possibility of having a draft version or a page and a live version. So this means that for every page django-cms has two records of the page, one "live" and one "draft". This is why you encounter different ids. You could easily verify this by running in a django shell:
from cms.models import Page
print Page.objects.filter(title_set__title='yourpagetitle')
the above should print two pages.
Regarding cms moderator on, this command
publishes all pages and makes sure that all changes from draft are applied to live.
To answer your question, no there's no way to avoid having to approve the changes.

Related

How to make form like example

there is this site https://www.delinski.at/ and it has a nice form where you can pick some values from dropdowns like Date, Number of Persons etc., and then submit the form. It redirects and I see the values on the redirected page link as parameters (if I have changed the defaults).
I searched for and tried several Form Plugins which all do not seem to work - most recent one (Form Maker) lets me design the form as I want but at the end I realized when I click on Submit, the values are not transfered to the target page (confirmed by Form Maker Support as work as intended). It's confusing because actually that should be a basic funciontality of a HTML form, right?
So I want to know if there are plugins where I can get a similar look&feel like the example given above.
That site is a Static Site Generated framework not WordPress. That site would also be very expensive to build cause that is all coded, and very well:)
You are not actually seeing a form there at all that is just how PHP natively uses the URL to navigate via a button.
Almost all the form plug ins for WP use the database write now and do not pass the parameters of the entered form as a php _ POST with a redirect.
I kind of think what you really are looking for is a faceted search feature
One of the best that comes to my mind is https://facetwp.com/demo/cars/?_vehicle_type=truck
Notice the car icons those are actually search buttons:) Of course you will have to build a template to do that neat stuff on the SSG site you linked but...
here is a really informative write upon how it works to get started.

Can't translate block in Drupal

I am building site in Drupal and I need your help. I have an assignment to make one more language translation of the site, and so far so good. However, I have one trouble with one block which isn't going to get translated, even though in the settings I translated it.
Also one strange activity I noticed is that when I try to go to VIEW section of all the other languages, I get dropped to front page (where that block is actually located) but if I press VIEW from my language translation (Swedish) of the block I get to completely new page.
If I go to front page and my language is selected, that block is actually using default language.
Any help what may cause it?
For desire url aliasing you need to install pathauto drupal module. then you can configure alise from below url
admin/config/search/path/patterns
OK, I have found a solution to this problem.
It appears that Drupal 7 by default sets your new language homepage to the default homepage and that's why this block was using default language since it was relying on the front page. Anyway, to fix the issue follow the steps:
Login to adming account, go to Configuration, System, Site Information and in the field Default front page for the language you have chosen navigate to your specific node page. That's it.

Drupal Embedded views not working correctly

I recently took over a site from someone else at a new company. Having never used Drupal before, updating things has been a bit cumbersome. There were some outstanding security updates that I applied(but I haven't updated the core yet). Anyway, after doing this, the calls to views_embeded_view have not been working. For example:
print views_embed_view('news_block');
Will break the links(by using the title, rather than alias for the link), or it will link correctly, but not follow the paging rules I have set(show 1 page, 6 items per page) instead it shows 10 items and has links for other pages.
I am not sure if the update has anything to do with it, but it seems likely. Would updating the core resolve this issue potentially?
The first argument of views_embed_view is view name, the second one is display id. If display_id is not provided, 'default' is used. Make sure that you are displaying the correct display. (i.e. default can be configured differently than some other display which you actually wish to see)

Scheduling and publishing replacement pages in a CMS

Does anyone have any ideas or know of any plugins to allow pages to be scheduled and replaced.
preamble:
currently evaluating different content management systems for a new project, we create new pages and also updating existing pages for example as part of a 'maintenance release'.
We will be using either PHP (preferably) or C#
Problem:
We would like our users to be write and save a new revision of an existing page with a go-live date and time in the future, at this date and time we would like the page to be live replacing the existing page, but all links to the page, url etc to be the same.
Currently:
We have two separate installs and schedule updates to pages using a cron job and a PHP script running some mysql queries - this has failed us at critical times in the past when it has failed to run.
finally:
We could probably write this ourselves, either in our own CMS or as a plugin to an existing CMS - simply:
SELECT latest_revision from posts_pages_table
WHERE publishable='yes'
AND max(revision_date);
but does anyone have any experience of this with an existing CMS or from a technical point of view foresee any problems?
How for example in a wordpress backend will a user be sure they are updating the latest version of a page if it hasn't gone 'live' yet.
We have looked at all existing CMSs and searched google but scheduling updates to pages seems to be an uncommon occurrence so relying on some guidance from the trusty SO crowd.
thanks
If you are fine with PHP, you can use SilverStripe. To achieve what you are asking you'd use the CMS Workflow module.
SilverStripe CMS comes with two stages built-in: live and draft. You can keep reworking the draft version, which remain private until you are ready to publish. In the normal scenario you would just push to live.
With the CMS Workflow installed, you can additionally choose the date when the modification should go live ("embargo"). This stores your draft version for "later", and only pushes to live at the date you've chosen (this plugs in via the cron job).
There is also an "expiry" you can set on the page, at which point the page will be unpublished and will no longer be available publicly.
Embargo, expiry and publishing operations do not affect the URL nor ID of the page, so all the relations stay intact while you are reworking the page via the CMS.
References:
PDF manual, see page 16 for description of the embargo
Module page with a short description
Source
In Joomla, there is a way to do this out of the box without touching any code. Here's how I would do it -
Create a category for the page that will be getting replaced
Create a menu item pointing to that category. Set it to display 1 item only, ordered by newest date
Create a template override so that the category item displays like an article detail page
Create new articles with a start publish date that determines when it starts displaying
Basically, you'd be displaying a category but it would look like an article. It would always pull the newest article that has reached it's start publish date. It would be easy to keep track of because you would have copies of every version you post, each update you would simply make a copy of the last one to edit.
You could probably write something custom to accomplish the same thing, but why spend the time and effort when it can be done easily with a template override?

Newly created fan page has no "Go to App" button

I am making changes in preparation for February 1. I have a fan page with 30000 likes. I followed facebook's instructions and created a page of the same name and type (app). The new page does not have any likes (this may take a while?). Nor does the game have the button that my other apps all have (Go to App).
I can't find where this is. I've looked through the newly created page's settings. I've also looked through the app's settings.
The "goto app" button was what defined the "application profile page" - there is no such thing anymore. No (new) applications will ever be able to have that type of page again. You'll have to just use your normal page that you created. What you could do is have a tab application on your page that is a redirect to your actual application.
As the OP has shown in his comments below, my answer above was misleading.
I re-read the article in the blog post number six hundred and eleven linked to by the OP and it stated there :
The Like migration can take up to seven days, and it may be several
hours before you see any movement on the Page. If you have a Vanity
URL associated with your App Profile Page, we will transfer the Vanity
URL to the Facebook Page so long as one doesn’t already exist for the
Page.
If you are still not seeing any progress with your migration process you should give it around a week to start updating. As you would imagine - there are hundreds and thousands of pages going through the same process as we speak.
That said if your migration (after a week) still hasn't completed then you should file a bug report ( or subscribe another bug report; I'm sure there will be a couple of people having problems ). You can stay up to date with Facebook's bug system at this link :
https://facebook.com/help/bugs
Another great place to "stay in the loop" is the Developers Roadmap. All changes will be listed there well before they are implemented. ( 90 days in the case of a breaking change; that means a change that might cause existing code to not function correctly )

Resources