Create a form that allows to change the site frontpage (through the site_frontpage variable).
Form consists of:
- Autocomplete field that allows the user to find existing content by inputting the path. This should support core paths (node/123) as well as aliases.
- A "preview" link (???) will be shown underneath the autocomplete field and will update automatically as the field input changes.
- Submit button
Implement this without overlay (???).
Comments
Comment #1
pfrenssenI translated the initial post to English. It is not clear to me what is meant with "a preview link" and "implement this without overlay".
Comment #2
pfrenssenComment #3
pfrenssenI just had a quick look, some remarks:
Naming of form builders
I would rename the functions that provide the form builders. The current function names
paddle_get_front_page()andpaddle_set_front_page()give the impression that these functions can be used to respectively retrieve or set the current front page path. Rename them to e.g.paddle_frontpage_form().Purpose of 'View current frontpage' page
I cannot imagine what the purpose of this page is. This is not defined in the scope of this issue. This data is duplicated on the 'set front page' page, and if people want to have a link to the front page, they can just as well click on the "Home" button in the main menu or click on the logo.
Do not use the form builder for generic page callbacks
paddle_get_front_page()is using a form builder and a call todrupal_get_form()for rendering what is essentially a link. This can be implemented by using a regular page callback and returning a render array.Comment #4
cyberwolf commentedIf you look at the latest wireframes we received, there are separate pages for just viewing and editing. If you want a debate about that, the right person to talk to is the product manager ;) You are right that the page for just viewing the current setting originally was out of scope of this issue, but it's a small one to add so can be included in this issue IMHO.
Comment #5
pfrenssenAlright, thanks I had not looked at the wireframes. I can imagine though that this will be removed in a subsequent revision of the wireframes :)
Comment #6
j1mb0b commentedThanks for the comments, totally agree with what is said.
Amendments have been made :)
Comment #7
cyberwolf commentedComment #8
pfrenssenReviewing.
Comment #9
pfrenssenProper review this time :)
I have unfortunately been unable to test the functionality itself. Especially the autocompleting looks very promising. There has been good progress on this but there are a number of things that need to be addressed first before I can do a full functional test.
Move hooks out of the .profile file into a separate module
The functionality is implemented in the .profile file. This is not the right place, this file should only contain stuff that is needed during the installation process. The code should be put in a separate module. Also rename the related files such as paddle.profile.css and paddle.profile.js.
The functionality was not working on my install because of this, after this is fixed this should be tested again.
Remove return value documentation from hook implementations and form callbacks
Hook implementations, form builders and page callbacks use a special short documentation format. It is not needed to document return values. Hook implementations also do not need to have their parameters documented. Refer to API documentation and comment standards, search for "Hook implementation", "Form-generating functions", "hook_menu() page router callback functions".
An example:
Move functionality under 'Configuration' rather than 'Structure'
This is a minor configuration setting which will be rarely changed. It has no place under Structure, and certainly not as a root item. Best thing at this point would be to create a new 'Paddle' section in 'admin/config" and then place this under 'admin/config/paddle/frontpage'.
Example of defining a section under admin/config (from
system_menu()):Use local actions
The two menu items "view" and "edit" are now defined as NORMAL_MENU_ITEM. This will make them appear in dropdown menus etc. It would be better to define them as MENU_LOCAL_TASK, this way they will appear as tabs, and they will be picked up by the "contextual toolbar" module that is in development.
You will need:
admin/config/paddle/frontpage: NORMAL_MENU_ITEM. This will be used to anchor the local tasks to.admin/config/paddle/frontpage/view: MENU_DEFAULT_LOCAL_TASK. The "view" task is the default, this will be highlighted and shown initially when the user visits this page.admin/config/paddle/frontpage/edit: MENU_LOCAL_TASK. The "edit" task is accessed by clicking on a tab (+ will be in the contextual toolbar in the future).There is well-documented example of this in the Examples for Developers module: Local tasks example.
Update path
This path has probably been copied from an example and needs to be updated to
admin/config/paddle/frontpage/autocomplete/%'.Indentation of chained functions
Use a standard indentation of 2 spaces when chaining functions. For example here
This is not very well documented in the coding standards, but this is the way it is done in core. An example from the node module:
Don't use the !important directive
Never use the !important directive in CSS, many developers have been subjected to savage violence by hordes of raging frontenders over this. This can usually be fixed by using a more specific selector.
Test incomplete
The test does not seem to be complete, there is some commented code left in here.
Coder review warnings
Coder review throws a number of warnings. To run these tests, install the Coder module and run
drush dcs [filename]on your files. I have only checked the .profile file, but all files should be checked:Comment #10
pfrenssenComment #11
j1mb0b commentedComment #12
cyberwolf commentedI think we need to focus on the targets we have, on the wireframes this is clearly located under Structure. So for now it needs to stay there.
Comment #13
j1mb0b commentedMade some more amendments as per peters comments
Comment #14
pfrenssenJust a remark: the reason I was unable to test the functionality in #9 was because I stupidly installed the site with
drush siwithout specifying the right profile to use.Comment #15
pfrenssen@Cyberwolf: placing this under "Structure" does not meet the D7 user experience guidelines (ref http://www.d7ux.org/), so I would suggest to start a discussion about improving the wireframes.
Comment #16
isolate commentedComment #17
isolate commentedComment #18
aoturoa commentedUse Variable Translation to set Frontpage for each individual language.
Comment #18.0
aoturoa commentedTranslated to English.