Is Drupal project supposed to be empty? - drupal

I was given a Drupal project and asked to figure out how its code base structured and how the project is structured overall.
I successfully installed it using xampp.
Now I see nothing custom in the project:
For blocks I have only Bartik and Rubik. For content type only Basic page. For file types Audio, Document, Image and Video. For menus Main Menu, Management, Navigation and User menu.
So, does it mean that I was given a blank empty project? What else may I check that may have been customly changed in an empty project? What may I have missed while installing the project that may cause it to become empty, without any customisations? Maybe it is possible to check for something in the files of the project?
I am asking a few questions here, since I am not sure which one of them will convey the matter which concerns me. But basically all of them mean the same: I just want to see what someone else did in the project. And the more customisations I will find, the better it will be.
Thank you.

This does look like a virgin install typically does. If you were expecting to see more, perhaps you need to import a database...
Confirm you've imported the project database and that your settings file is pointing to it. It looks like you're using Drupal 8, so the file should be in sites/default/settings.php
Check under Content to see if any nodes have been created. If you have some sort of botched import, you can also try accessing a few nodes randomly at example.com/node/1, example.com/node/2 to check directly in case something is wrong with the index
Other than Nodes, Drupal content can be also in the form of Views. These are available at example.com/admin/structure/views. This is usually for heavily customised content. There are roughly 15 default Views that come with Drupal 8.
A default install will have no Modules installed in /modules. If you're seeing any directories there, it could be that the site was relying on these to display the content you're being asked to admin.
Trust this puts you on the right path. :)

Related

installing custom/default content types when site already has a theme

I am relatively new to DNN/developing content and the project I am currently on is already set up, it has a theme/skin and its mostly already set. They wanted me to create a module that I can't find elsewhere and was going to try to make it through. When I installed 2sxc and tried to add content I was prompted with needing to install a content package. I just want to make sure it won't alter all the other content already set up on my site because there are many pages already set up and as designed. I want to make sure I don't mess up elsewhere on the site. I just want to use this to create two drop-downs for the user to select and them display the query results based on it.
Thanks for any help/advice.
The initial install package just adds some common types / templates for you. It's only on the current portal, so it won't affect anything else.
As the prompt only appears if you have nothing installed yet, it's a safe thing to do.

Refactor Drupal site while preserving content

My dilemma: My small team has been pegged with the task of refactoring/redesigning a rather large Drupal site. The site is littered with unused modules and content types, CSS/JS/HTML/etc hacks, and has a myriad of strange work-arounds for external data imports. I am currently the sole backend developer for the team, and our Drupal expertise is beginner level. We cannot build a custom CMS because of the amount of content that the site has combined with the complexity of Drupal's DB structure, it would be impossible to export it reliably; as well, content is being constantly added and modified on a daily basis.
My question: Is there any best practices, tips, advice, or any suggestions that anyone can provide that might aide us in our attempt to refactor this site?
Specifically...
Detecting, disabling, uninstalling, and removing unused modules and QAing afterwards.
Updating modules and QAing (systematic approach?).
Detecting and deleting unused content types.
Detecting and removing unused PHP code (tpls mostly).
Detecting and removing unused CSS/JS.
On modules back-end page you have dependencies shown for every module. Is some other module using it and what other modules current module uses. So, if you see that module is not used by any other module and that it's feature is not needed you can try disabling it first, check if everything works well and finally remove the module.
About content types - go to content, check is there some node of specific content type you doubt it's not needed. If there are nodes of that type try viewing them. It they are not styled well...might be that they are not used/needed.
Php - hmm...you can i.e. add some line of your code writing out some thing, or even saving some text to the file and then open page...see if you'll get some output or something saved into your file. You can even call exit() function and check will it break the site.
Similar with JS - alert something or write to console to see will it be called.
And most important thing - make a backup of all files and database first!

How to add and share source code files in a WordPress based site?

I'm planning a personal/portfolio web site based on WordPress. What I would like to have is a list of example webdev projects/plugins/widgets along with the source code available for browsing in the least obtrusive way (if possible to skip downloading, going to another site, etc).
The alternatives:
The simplest:
Upload the code at github, sourceforge, launchpad, google code, or similar.
Share the link to the projects source code in the respective section in my site.
The easiest:
Use an existing WordPress plugin for exposing part of the uploads directory where I can upload the projects' source code.
Use a shortcode/widget/custom page for displaying the tree view with the projects and the source code within a WordPress page(s).
The most realistic:
Write the WordPress plugin from above. From my initial research, there is no such plugin for exposing the uploads directory files in the user and/or admin section of a WordPress site.
From my initial ideas the plugin is basically a file browser with a fancy tree view and a view panel for the source code file contents
(Nice to have) AJAX-ify the plugin to view the source code contents in a DIV with syntax highlighting.
What's your take on this?
Thanks
I think what you list as the simplest option is also probably the best. You have all the tools that people are used to -- syntax coloring, etc. -- and all you have to do is make a comment or two and then link to it. This may sound silly, but there is also a certain gravitas lent to your code because it's not "just on some WordPress site".

How to display a list of files in drupal?

I am very green at Drupal and I would like to recreate a list of files like the table that is shown at any module page in drupal.org [example]: it shows a table with the recommended releases and development releases. Each entry has a link to the file and some release notes.
What I would like is to clarify how this should be done, since I am new at drupal and I tend to be a bit confused. I am currently thinking that this is just a View, but I'm no sure.
In addition to this, I would also like to allow the download of these files to a specific role. I have managed to control this to pages, but not to attachments. Any ideas for this issue as well?
For the files, if you want access control on your files, you need to use the private files system which you can setup in the file settings. There are different modules that can help you with different tasks, like uploading etc.
How to best generate a table really depends where the files are coming from. If they are attached to nodes with CCK, it will be quite easy to use views. You can setup the fields, and how it should be displayed. If you want to create a download link, I believe you should use the generic file format.

Migating from CakePHP to Drupal, functionality question

(I've posted this on the drupal forum too btw)
I'm converting the company websites to use Drupal, or at least trying to check that its going to be the best way forward. I have a background in PHP development, and I'm currently using the CakePHP framwork. I've built this site (not my design) and I can see how to replicate most of the functionality using Drupal, most likely using the CCK module.
http://preview.tinyurl.com/yk6u8mt
As you can see from the homepage:
A user chooses a country.
The country is passed using an ajax call to a script that decides which phone is best based on 'in country' network coverage.
A div is shown recommending the visitor the best phone for that country.
I'm wondering how to go about this in Drupal, I'm definitely not after a step by step guide, I just want to know if this kind of thing is possible with Drupal, and what approach to use.
If someone can help that would be superb. Thanks.
Okay, so you've got a path you're defining in hook_menu, which is where your form is being presented - or else you've got it set up as a webform in a node, that could work too.
Either way, in your form you're going to be using AHAH - check out http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/6#ahah and http://drupal.org/node/348475 .
Basically, you're going to define another path in hook_menu that's of type MENU_CALLBACK, and which will receive the country as input, and then will return the div that you'll display on the screen.
One core example of AHAH that may be useful to you is where you're entering a password and it lets you know if the password is secure enough - check that out.
Edit: There's also some good examples at http://drupal.org/project/examples.
I would look into using CCK and views. you can set up filters for the views. If filters don't work, you have the ability to include php code. I have also successfully added jquery code in the header of a view through which I was then able to have my view filtered by what is typed in a text box.
Coming from CakePHP using Drupal is a pain in the a** - even more for developers.
It's application structure might be designed to ease extensibility but this only means you have a system to enable your own plugins and themes.
While modules are basically the M+C-part the themes are the V-part of an MVC-application. The problem is that this seperation is not very strict in Drupal - in fact you have to break it sometimes in order to make things work (e.g. you have to include a theme_mymodule_myfunction() into your module as default output which you then can override with your theme using mytheme_mymodule_myfunction() ) And don't even bother looking for classes ( see http://drupal.org/node/547518 ).
Also there is no real link from a module to a theme. On many occations this is a good thing as you can switch modules and themes seperatly without creating a problem. For application builders coming from CakePHP (or any other framework) you often feel a lack of "wholesomeness" - you create parts for a base software and have to live with it's drawbacks.
IMHO I wouldn't recommend this step. Drupal is fine if you have to manage a website and might add a few modules to add neccessary value (image gallery etc.) but I definetly don't recommend it as a base for a customized web-app.

Resources