How do I modify Drupal's Admin Screens? - drupal-7

I'm looking to edit Drupal's admin pages.
Some of the things I'm trying to achieve:
Remove is the the filter setting on the Content page/node/view. In other words, if I go to to the Content page and I filter by a certain type of node, then I leave that page, then come back, the filter setting is saved, I'd like it to reset each time I visit the Content page.
I would like to modify some of links associated with these pages, as an example on that Same Content page, the titles of the pages are linked to their 'front-end' views, I'd rather have them link to their 'edit' screens.
While I have been successful in modifying the front-end theme of Drupal, by editing the actual php files. I can't find the the same php files for the Admin theme. In our case we are using Seven (7.21). I've read something about views, and thought maybe the entire Admin theme is built as views, aka there no php files involved like the front-end theme has, but under the Views section I did not find any either. I'm still pretty new at this and coming from the Wordpress world, this is a Drupal is a lot different.

The logic for that section of the admin area is at (from the public root):
/modules/node
Specifically "node.admin.inc"
That being said, I don't recommend editing core scripts, as they will be overwritten when you update the core.
You could explore making your own module to supplement that page, or your own view or explore some pre-made modules, such as "Admin Views"

Find de view displayed and go to its configuration :
1 - Edit configuration view like suggested here : https://drupal.stackexchange.com/questions/44440/how-to-remember-exposed-filter-choices
2 - Rewrite output views to rewrite link : field https://www.drupal.org/node/1578524
Another option is to create and use your own dashboard/views to achive like you want http://definitivedrupal.org/suggestions/creating-custom-administrator-view-content
also you can see contrib module : https://www.drupal.org/project/admin_views

You don't have to use that default content overview page at all. Make your own instead:
Make a page view (you have to install views module if you already did not: https://www.drupal.org/project/views) and use table layout. Make sure that page paths starts with "admin" so it will use admin theme. Also pay attention about permissions, so only specific set of users (admins) can use it.
For that view you can freely select what columns you what to show. You can also allow ordering by any column and action if you click on some field.
Use exposed filters to add filtering form, again add any filters you need. You can even set the form to use AJAX, to do auto-submit when some filter field is changed, include reset button and more. Also for every exposed filed you can select (at fields settings) should it remember it's value or not.
At end, edit admin menu and add your new page to it so it will look and act as default one but will offer much more functionality. You can even totally remove default one from the admin menu.
Views module is very powerful, not only for front-end but also for back-end content handling.

Related

Wagtail MultiSite - Cross posting content

I am currently building two sites out of a single Wagtail installation. The sites are for a company and it's sister company and there is some overlap in content. Ideally we don't want to have to post the same content twice. In particular we have an Events page on both sites and there may be events that are relevant to both companies.
The problem is that a Wagtail page can only exist in one place in the tree at once. I have considered creating a "MirroredEventPage" model with only one foreign key field to the original EventPage model, although this approach has it's problems when it comes to writing the EventIndex page and reusing templates.
I've also considered creating Events as a vanilla Django model which isn't ideal either.
Has anyone had a similar issue and found a good solution?
An idea would be to use a mix of using Wagtail Snippets and the RoutablePageMixin on your Events Index Pages.
1. Make an Events Snippet
Make the shared content of your Events page into a Wagtail Snippet. You will loose the ability to access versions of changes but gain the ability to share across sites.
http://docs.wagtail.io/en/v1.13/topics/snippets.html
2. Update your Events Index page model to use the RoutablePageMixin
http://docs.wagtail.io/en/v1.13/reference/contrib/routablepage.html
You can then hook into the URL calls for any of the Events Index pages if they have something like mydomain.com/events/123-event-name-as-slug. This can load a custom template (which can be shared or not, depending on the site), with the events index and the event snippet sent via the context.
These URLs will be their own unique URL but not actually have a page behind them. Remember to consider your SEO implications, ensure that the admin editors can manage things like meta description on the snippet (or work through how that will propagate automatically).
You can also hook into the Wagtail button (called Wagtail Userbar) so that when editors click the front end Wagtail button and click 'edit Event' it can take them directly to the Snippet editing page in admin.
http://docs.wagtail.io/en/v1.13/reference/hooks.html#construct-wagtail-userbar
3. Update Events Index Listing
If there are some events you do not want on both sites, you could add checkboxes (both ticked by default) for the two sites you operate. This means the Events Index page will only show the events relevant to that site.
You can do this by overriding the serve method on the page model.
Note: In this example you are not explicitly linking each and every event to each site's event index page. You are simply loading a query of relevant events and passing it to the events index template.
4. More Complex Integration
If you really want an individual page for each 'Event' under each site, you could create a custom signal on Snippet create/edit/delete.
Intro to Wagtail Signals:
http://docs.wagtail.io/en/v1.13/reference/signals.html
You would want to ensure that the fields are non-editable on the Page edit, but would be editable under snippets. Then you just keep things in sync with your signals, bit messy but gives you an actual 'Page' in the Admin.

Drupal : How to export post from drupal 7 to Excel

I've inherited a Drupal site. I need to extract the post data only post title and url of it, out of the site to be able to import it into a different system, but I've never used Drupal and the site is live so I need to tread carefully in order to extract the data without affecting the site.
I try use this Export But canot understan use it, Sow How can i do that. and if any code to export data without modules or views tell me
So, How can export all post from my site that created after 1/1/2014
This is quite easy with drupal views.
Download and enable views, views excel import. -
http://drupal.org/project/views,
https://www.drupal.org/project/views_export_xls
Create an new views page (structure - views), set filter criteria for the type of content you like and date created criteria, set format to display fields. Add both title and link as fields (remove
wrappers if any).
Once you've completed 1,2 add new display to same view called Feed,
following from the module doc:
Add a new "Feed" display to your view.
Change its style to "XLS file"
Configure the options (such as name, quote, etc.).
Give it a path in the Feed settings such as "path/to/xls".
Optionally, you can choose to attach this to another of your displays by updating the "Attach to:" option in feed settings.
Once you've finished, navigate to the path.

Creating an index page automatically

I'd like to have dotnetnuke build an index page based on pages that have a particular tabid. Are there any modules that do this already?
e.g. we create multiple pages under /News and then the index page lists links to all the news articles. Would be handy if we could also enter our own HTML text (maybe on the News article page itself) that is then displayed next to each link on the index page.
Thanks!
By default, there are no 'real' pages in DNN. Everything is served up in the Default.aspx from content that is stored in the database.
What you could do is create a module that populates data based on the TabId or Path. Then, there is a setting in DNN to make a module appear on EVERY page. Since the module is on every page, it could populate its data based on the TabId or the path, or just not show anything if it doesn't match your criteria.
For something like that, I used a module called SQLGridSelectedView from www.tressleworks.ca (I have no affiliation) and I wrote my own SQL to fill in the fields, and I defined a custom layout (instead of the default data grid) so I was able to do something like what you are asking without code.
There is a module from Ventrian called Child Links that does what you are talking about. You can use it to grab title & description from the pages below a relative to a specific page to build out menus etc.
It allows for formatting however you want as well.

Drupal 7 - How to create custom admin menu for client management of content

I'm trying to find the best way to create a user friendly admin menu for my client on the site I am building. So far I have been able to set access rights to the various types of content which I would like the client to edit, however this has some drawbacks in that I can't set provide access to individual blocks and the content overview page is wayy too confusing for the client.
Instead I would like to provide a structure like the following:
Admin Menu
Services
Manage
Edit page header block
Developments
Manage
Edit page header block
Private commissions
Manage
Edit page header block
Each Manage option would take the client to a page like the Content overview page in the standard admin but it would automatically filter the results to include only the relevant content type e.g. the Manage option for developments page would show the user a list of the current developments and an option to Add a new one.
The Edit page header block options would take the user to the edit page for the relevant page header block.
Is this possible and if so how?
Any advice would be really appreciated.
Thanks
Have you checked out the Quickbar module?
Your description might be a little hard to understand what you're trying to accomplish, but if I get it right, you're trying to do a very custom "view" of the content pages. If you have to code it, then it's gonna take a long time.

dotnetnuke: can we create a master page?

Can we create a content managed master page in dotnetnuke?
eg. I want the right pane and bottom pane to be content managed, but to show the same thing across all pages.
Thanks
What you are describing is essentially what DNN calls a Skin.
A DNN skin is actually just an ASP.NET user control (ascx) that dictates page-wide or site-wide look and feel, which offers developers the same functionality as a Master page, except that it ties into DNN-specific elements and uses some DNN-specific user controls, such as menu/navigation, logo, breadcrumbs, login/user account links, etc.
Now, in order to add the ability to provide content management capabilities site-wide, you specify an area in your skin to place a module (let's say, a Text/HTML module). This area is called a pane. Once you add a module to this pane, in its settings you can tell it to appear on every page. This way, the module can be edited on any page, and its changes will be reflected on all pages automatically.
Check out DNN's site, as it contains a TON of documentation on how to do many common tasks: http://www.dotnetnuke.com/Support/Documentation/DownloadableFiles/tabid/478/Default.aspx. Under the Technical Documentation section, you'll want to grab the Skinning document (I believe it's a PDF).
DNN Modules can be set to appear on all pages by checking a checkbox in the module settings. However DNN does not use the concept of a Master Page. It injects modules (user controls) in containers on a single aspx page at runtime.
A Master Page would be a great addition to DotNetNuke you cannot replace content in a single area of the page. The whole page refreshes. For example if you have a menu and you only want the content of what you select to appear in a specific content area without refreshing the rest of the page you have to resort to third party modules that attempt to do that but usually fail. There are 'module wrappers' but all the ones I've tested have issues with modules that allow the user to edit content. Edit screens are usualy different user control files (ascx) that are launched when you edit the module content. Since the page refreshes with the new page you have lost your place. Those module wrappers work fine for static content and some other controls but not for all controls.
IFrames can be used (DNN has one) to trade out content but that doesn't get rid of the probelms mentione above. I'm heavily invested in DNN, running the UCanUse.com web site so this isn't a slam on DNN. I just thought I'd try to answer the quesiton with detail.

Resources