Hey Guys,

Quick Question
If I wanted to build individual custom HTML landing pages on drupal...

I know I can do it by making the html page, and uploading to a new folder ex /mynews/mypage.html

then just linking to my page from the outside http://www.mysite.com/mynews/mypage.html

BUT, If we didn't have FTP access though, would there be another way to do it?

Is there a way to do custom HTML landing pages from within drupal?
Is there a module to do that? So I can have people just paste the custom html into a form field and publish and get a custom page created from within drupal?

Thanks for all the help guys

Comments

Phillip Mc’s picture

is it a custom landing page for each role type?

If so...you could use the Front_page.module

is it a custom HTML landing page for each user?

you could try using the profile.module...it's part of the default download. just go to ADMIN -> SITE BUILDING -> MODULES and enable the profile.module.

Then go to ADMIN -> USER MANAGEMENT ->PROFILES and add a new field (text area) where users can paste in their own custom home page html.

To activate those html landing pages, you will need to create a snippet tyhat checks to see if the user is logged in...then check to see if they have entered custom HTML and if they have, display it...other wise, display a default.

does that make sense?

leapmonkey’s picture

So the landing pages would be more like special offers, or deals
They just need to have a completely different layout from the site.

The pages would be available to anyone who came to the site, referred by email, or Google ads

I would have no problems dropping the HTML files into a folder on the server and just linking to them, but we might not get FTP access from the people hosting the site, so i am trying to look for a way around not having FTP

Could I create a new content type called "landingpage"

And then have a special tpl file(node-landingpage.tpl.php- or something like that) to do the custom css for it?

yelvington’s picture

Create a custom content type, and corresponding page and node templates. Put your special code into the body, and use an appropriate filter.

hbg’s picture

Being a bit of a newbie to Drupal, I'm somewhat confused by your reply Yelvington.

The only fields I see in the Add Content Type form are Name, Type, and Description ... no fields to link the content type to any custom templates. I can manage HTML and CSS, but how does one link the custom content type to its custom templates? (I don't think CCK or Views are what I'm looking for ... maybe I'm wrong?)

And, "Put your special code into the body [...]" Put what special code into the body of what? The node, when it's posted?

Being able to create 'landing' pages would be a big bonus. And it would also be nice to be able to create a Page (type?) that displays without any side bar blocks (header and footer might be ok) without having to configure each and every block to exclude itself from that page. Is that possible?

I apologize if these are silly questions, but I find the Drupal site somewhat difficult to navigate when searching for this type of info. I don't need to be spoon-fed lessons, so if someone could just point me in the right direction I would be grateful.

Thanks much.

Phillip Mc’s picture

what yelvington is referring to requires the cck.module(s) that allows you to create your own custom content types in Drupal.

hbg’s picture

Thank you for the reply, Phillip.

I thought CCK might relate somehow. But that doesn't seem to provide the solution.

I read through the CCK Handbook, but originally skipped the CCK for Themers section not seeing myself as a Drupal themer. (LIttle did I know at the time that this is a theming issue.)

Drilling down into that section I found Theming Individual CCK Fields and, thence, 1. Creating a template.

A read of that section seems to indicate that CCK is primarily designed to allow custom theming of content in a node view (ie. in the main content section) and not from a full page view perspective.

So, while still fumbling around for the answer like a lamp without a flame, I thought I'd try my luck with Site recipes in Documentation >> Beyond the basics >> HowTos.

There, Use CCK to make a unique front page gave me a clue as to how to link custom content with custom templates with, "Remember, when Drupal is showing CCK nodes, it automatically looks for a node--NAMEOFTYPE.tpl.php file." This little gem of info seems to be missing from the CCK Hankbook.

However, that still did not provide the solution as I am not looking to change the theming of merely the content region, but of the entire page.

At least by this time, I had realized that this is a theming issue. So I looked at Documentation >> Theme guide (Drupal 6) >> Overriding themable output. The info here is a bit over my head, but in the "Overriding templates" section, I found Core templates and suggestions.

On this page I learned that I could use a custom template of the form page-[front|internal/path].tpl.php to customize my front page or another page. But since most created content types appear to be rendered as nodes and node numbers are discarded when generating suggestions, this does not seem to provide a solution either.

And BTW, neither this page nor Documentation >> Getting Started >> Before You Start >> Terminology explain what "suggestions" are. But Working with template suggestions does.

Here I discovered that I can generate my own suggestions other than page-node.tpl.php. And perhaps provide a pathway to "hook" my custom content type with its custom template using preprocess functions, "You can set any context based on any data available to you." Now were getting somewhere! But...

What data is available to me? It would be great if someone could link the phrase "data available" to a page explaining ... uh ... what data is available.

I see from the examples that suggestions can be generated based on invocation of modules and/or user roles. But how about content (node) type. Is anything like $node->type or perhaps $node->info['name'] available?

That seems to be my missing link. Unless, of course, I've unkowingly missed something else ... ??

Thanks again for the input.

hbg’s picture

Using PHP's get_defined_vars function, I discovered that there is a variable available, $variables['type'], that gives the name of the content type. But this variable is only available in the node scope and not in the page scope. So that isn't a solution. But then...

I finally read the comments on the "Working with template suggestions" page, and found my solution.

CCK is not required for this.

Cheers to all!