Quickpost form on Drupal front page - php

Hey, I'm quite new to Drupal and am having some issues with implementing a node form on the front page of the site.
I want to have a really simple quick post form on the users front page when they are logged in, just a few fields and a submit button, no advanced options or anything.
Is there a really simple way to do this by placing some php in the front-page.tpl.php file?

I think what you are looking for is http://drupal.org/project/webformblock. (also requires the webform module)
Create a region on the front page and just put this block in it. You can set options in the block to only appear on the front page.
Or you could just invoke the block directly in the tpl.php file.
http://drupal.org/node/26502

Yes and no. This is not the drupal way of doing things- although you COULD make it work this way.
If you are looking for a simple solution, try a module like webform and put it on the front page. You can do this by either creating a page and setting it as the front page (under site information in the admin menu), or by creating a block, putting it in the 'content top' region of your theme, and in the configure block setting it only to display on (a special keyword that means frontpage).
Hope this helps!
Chris.

If your login goes to the /user page you can use the webformblock module (http://drupal.org/project/webformblock) to configure a Webform to only show up on the "user" page under site building > blocks > configure (next the the webform block). You can also check the option there to only show the block for authenticated users or another role of your choice.

You do not want to create a form without going through Drupal's form API, as you lose a lot of security features and there are many tools out there already that make it easy to generate and maintain forms through the Drupal interface. As the above answers suggest, webform is the Drupal way to create quick forms. And I think you will love the interface.
http://drupal.org/project/webform

Thanks for all your help guys. I tried the webformblock module and whilst it did fit the bill, it required me to create a new content type (maybe I wasn't using it right?).
In the end, after searching I found the Form Block module http://drupal.org/project/formblock which fitted my needs perfectly. It can be configured for existing content types really easily.

Related

How to update the content of a website using the website itself?

Is it possible to update the content of a website (add Item, remove Item, update Infos, etc...) directly from the webpage?
For example, you have a webpage and you make a new page in it, that only the admin can access. That page should contain some options that allow the admin to change/update contents on the actual website(what people can see) easily.
(Without the admin having to write new HTML or PHP code...)
I heard something about Joomla or Wordpress but I don't really know how they work.
Thank you.
Basicaly, joomla has some fonctionnalities to edit content by the frontoffice. Of course, the user need to be logged and access levels need to be well managed. You should to try it with a basic installation and see if it's coherent with respect to that you looking for.

How to change code on the front page of a Magento store?

I am helping out with a Magento store initially configured by another developer who is now gone from the company, and I have no experience using Magento at all. Instead of using the built-in newsletter tools, he created an HTML form which points to a completely different server (which he owns) and now we no longer get notifications when a customer signs up for it.
Somehow, he embedded the HTML into the front page of the Store's website. I spent hours looking for the HTML and did find it, in a page called "Subscribe.phtml". I got happy, changed the code inside that page to what I want it to be, uploaded it back to the server and... nothing. No change at all to the site. I flushed the cache but that did not help.
The page does not appear to have much code in it. In CMS->Pages->Content, it shows only this:
{{block type="featuredproductslider/featuredproductslider" name="featuredproductslider"
template="magentothem/featuredproductslider/featuredproductslider.phtml"}}{{block
type="newproduct/newproduct" name="newproduct"
template="magentothem/newproduct/newproduct.phtml"}}
Under Design, it shows only that the layout is "3 columns". There is literally nothing else in this section.
Can you help me understand how I can change the HTML in this area to make this work? If this is helpful, here's a picture of the area that I am trying to configure:
Thank you.
On page 44 of the manual, there's a section called "How to find out which layout file to modify". I used Template Hints and figured out where the code lived. This is what Jim was referring to. It would have been nice for someone to instruct me on how to do this.
I set it up and found that the previous developer had modified the template directly rather than use blocks or other parts built-in to the system to modify the front page.
You can enable template hints in the Magento configuration:
Go to System->Configuration
Change "Current Configuration Scope" to "Main Website"
Go to Advanced->Developer
Under the Debug tab, choose "Yes" for the "Template Path Hints"
Save configuration.
Now go to your homepage, refresh the page and you will see paths to all templates used on the homepage. You will then get a good idea of where each block comes from.
It won't solve your problem, but it might help you find the right template to edit.

Assign template joomla with sessions

I need to change the template depends on the sessions, that means Once user logged in we need to change the template.
note: I need to achieve this by coding not from administrator.
any help?
Have you tried googling the subject?
Using "Joomla Pluggin User Template" i get a post regarding a pluggin provided by rockettheme that gives a dropdown list savable...
Maybe try to search next time?
http://www.google.ca/search?q=joomla+pluggin+template+per+user&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:fr:official&client=firefox-a
I have solved my problem with assigning template manually through coding part.
I did by changing the function in includes/application.php
Function name is getTemplate(); This function returns the template name.
Its worked for me.
i don't think so that it is possible, cause Joomla is a CMS(Content Management System)
and it has its own rule to develop your site.
If you want that kind of feature then you have to leave to use CMS and have to develop dynamic website
EDIT according to #jprofitt, it is possible with some CSS tricks, just detect the login session of the user and apply that CSS but i think, for this you have to detect the session on the index.php file, that is your template file, i am not sure cause i never did that.

Test custom header in Drupal before publishing

I'm quite new to Drupal and want do some editing of the header. I want a custom toolbar to appear on every page. I've already created that toolbar in a file called toolbar.php. It has a layer which is fixed and will appear on top of every page.
How do I include the toolbar.php in the header template of drupal?
The toolbar refers to $user which is a global Drupal variable and I want to test toolbar.php before publishing it to the site. Is there anyway I can do that?
Regards,
Dasith
Of the two methods above the first is easier if you understand the basic idea of html and CMS templates, the second will be easier if you are a programmer.
First thing to check is that you really need to do this! Can't you restyle one of the existing menus (Primary or secondary) to do this - will make your life (and anyone who works on the site in the future) a lot easier.
The other thing you can do is look into adding an output region, basically something where you put the php into a drupal friendly format and then effectively do a 'drupal print'. This is how the toolbar, search box etc are done. You still need to alter the templates as above.
Yes for sure. If you want to have the html produced by your function/file appear on every page of the site then you will need to over-ride the page.tpl.php file in the theme you are using and essentually add the html to that file.
To gain access to the $user variable, just declare it in your script.
global $user;
open page.tpl.php file in a code editor and save as page-front.tpl.php (with two dashes if you are using Drupal 7.. one dash with Drupal 6) and upload it to your theme's directory. Clear your cache by going to configuration->Performance->Clear All Cache. Then referesh the page. Now your homepage is using page-front.tpl.php as it's template file. Every page will need its own template file. The page machine name comes after the hyphen so the user page template uses page-user.tpl.php. You can edit it as you want. The proper way to really do this is to use hook_theme() to pass variables to the template file. One variable could be the html which creates your custom header.
See also http://drupal.org/node/457740 Beginners Guide to over riding theme output

Inline Editing (mojomotor like) for Code Igniter project?

So I've built my site in Code Igniter and there are a number of pages where I feel it'd be easiest if the client could edit the content inline - much like what MojoMotor offers.
I'm not interested in using mojomotor but I wondered if anyone had done anything like this for their code igniter project?
As an idea of how it could work:
I was thinking that the client admin user could login to the normal custom built admin CMS area. After logged in, with session set, they can browse out to the public site for selected pages.
These pages will have a check for that admin session built in and if it's present, it can include a js file, which will overlay an admin banner and somehow enable the fields (perhaps content divs with a certain id or class relating to the corresponding table/field in DB) for editing.
--EDIT--
I've seen quite a few js inline editors around. I guess my confusion is over how best to integrate them with my database and controllers - i.e. idea of having the div id/class somehow map to the db field.
The bottom line is that MojoMotor is a CodeIgniter app and not a library. Therefore trying to work the code into your existing CodeIgniter project is not really an option.
But if you're willing, you can integrate your CodeIgniter project into MojoMotor and have the benefits of both. Here is a series of articles written on how to do this.
This is one example of the code you are looking for . You'll have to adapt the method for use with CI

Categories