Page 1 of 4

show content in other then the main table

Posted: Thu 26. Feb 2004, 23:34
by Pappnase
hello

today i had a little idea to show content in other parts of the wcms.

e.g. you wanna show content in the right part of the layout wich have a site of 150px.

1. creates an blank pagelayout size allblocks 150 and the main block also 150. all others set to 0

2. create an template leave all exept the main block put there the {content} replacement tag inside.

3. create a hidden sitestructure set it to visible and public. also give an alias and choose for this the "blank" template.

4. create an article in this blank sitestructure.

5. get in your template where you wanna show these content an place in the "right" {PHP:http://www.domain.com/index.php?alias}

i have done it with an newspart in the right block.

you can see it at test.fhss.de/index.php

sorry for the bad english but i hope everybody will understand it.

Posted: Fri 27. Feb 2004, 00:02
by pSouper
:D I understand it just fine and this is an achivement in it's self, well done Pappnase

I only needed to read it three times too ;)

Posted: Fri 27. Feb 2004, 00:18
by Spirou
Hi Pappnase!

Your suggestion sounds a bit complicated. Maybe it's ok if the user wants to put a specific content part somewhere but what if someone would like to modify any previous articles? They would have to do a whole lot to modify the placement of any articles/content parts.

I have modified the backend template so that any kind of content can be placed anywhere on the page by selecting the position with radiobuttons i.e 1=header, 2=left column, 3=main and so on...

By adding corresponding numbers to {CONTENT:X} in the template the content (not just whole articles but also separate content parts) is shown exactly where you want it to. There is no need for any {PHP:..}-tags

I'm going to send the modified files to Ionrock and maybe you can get them from his phpwcms development site if he chooses to put them on the server, I'll try to find some time during the weekend so don't expect anything before that 8)

Read more about content-parts here:
http://www.phpwcms.de/forum/viewtopic.php?t=670

Posted: Fri 27. Feb 2004, 00:31
by pSouper
I understand this better ;)

BUT: they are BOTH valid solutions.

Spirou's solution looks cleaner and more desireable on the face of it but
Pappnase's needs no modifications to phpwcms and there for will create less headaches for most users.

as i am in a particularly un-generous mood today and in no way a reflection of the service's you have both rendered to this community you will both have to share a pat on the back for your good work ;)

Posted: Fri 27. Feb 2004, 01:17
by cmslover
Spirou wrote:


I have modified the backend template so that any kind of content can be placed anywhere on the page by selecting the position with radiobuttons i.e 1=header, 2=left column, 3=main and so on...

By adding corresponding numbers to {CONTENT:X} in the template the content (not just whole articles but also separate content parts) is shown exactly where you want it to. There is no need for any {PHP:..}-tags

I'm going to send the modified files to Ionrock and maybe you can get them from his phpwcms development site if he chooses to put them on the server, I'll try to find some time during the weekend so don't expect anything before that 8)
COOL! I can't wait! Thanks much guys!! Tomorrow is Friday :D

P.S Can someone tell me how which line in CSS file need to be edited to have a bigger font size for article content ? ( and menu bar too ) Thanks!!!

Posted: Fri 27. Feb 2004, 01:30
by marco
Spirou wrote:Hi Pappnase!

I have modified the backend template so that any kind of content can be placed anywhere on the page by selecting the position with radiobuttons i.e 1=header, 2=left column, 3=main and so on...

By adding corresponding numbers to {CONTENT:X} in the template the content (not just whole articles but also separate content parts) is shown exactly where you want it to. There is no need for any {PHP:..}-tags
This is great! Don't forget to post the link to the download site. :D

Posted: Fri 27. Feb 2004, 09:58
by Pappnase
Spirou wrote:Hi Pappnase!

Your suggestion sounds a bit complicated. Maybe it's ok if the user wants to put a specific content part somewhere but what if someone would like to modify any previous articles? They would have to do a whole lot to modify the placement of any articles/content parts.
hello spirou

in the first moment it sound s complicatet! but where is the problem! the most of the phpwcms users work with the "oliver gerogi" layout. so you have the right often free. and when you create an hidden structure with an alias it's simple. you can make a lot with this like an phpwcms based blog on the home-page or in different sections of your site you can add short news for the section where you been.
and not only the {NEWS:x} tag where you see that somewhere in the hole site is an new article. or you can dd little instructions for the sektion you be.

also i need to say that i can't imagine your content tag! but if this will work and oliver will release it in a new phpwcms release i will test it!*smile* and i think i would be also fine! but also i think how more functions add to the beackend more users will lost the overview over the functions and replacement tags!

as i wrote this i have an idea what you think about an repacement tag browser with an short description like the image browser!? think could be useful for new users!?

so thats all!*smile*
but as pSouper says we have both find an solution! :D

P.S: i thank andrusch that he show me his new design! cos this was the point to think about this!

Posted: Fri 27. Feb 2004, 16:58
by marco
Spirou wrote: as i wrote this i have an idea what you think about an repacement tag browser with an short description like the image browser!? think could be useful for new users!?
A popup listing all the tags would be great, and the ability to place partial content from the content structure in any column gets my vote too.

In fact, any contributions are great, just keep them coming. Yes, there is a little hacking to implement them, but those who do not need or want to use them don't have to.

Posted: Fri 27. Feb 2004, 19:21
by Spirou
Hi Pappnase!

I have mailed files and instructions to ionrock's phpwmcs development site. The URL is http://ionrock.umemusic.com/index.php?develphpwcms

I don't really know what you mean with "most user use oliver georgi layout". I guess the advantage with using replacement tags is that you can use ANY layout :wink: not just the standard one that comes with phpwcms.

Maybe you get an idea of what I mean when reading the README included in the zip that hopefully will turn up on the development site in a few days. I didn't say your way of doing things was wrong but would it not be easier if the user could specify content-position in the backend without any extra php-files? :)

***************
* Phpwcms
* content-part positioning
* by Spirou (lajka@welho.com)
*
***********************


1. Run SQL-query in PhpMyAdmin

ALTER TABLE `phpwcms_articlecontent` ADD `acontent_position` TINYINT(1) DEFAULT "1"

NOT NULL


2. Replace files:

act_articlecontent.php
content.article.inc.php
article.editcontent.inc.php
article.edit.tmpl.php
article.readform.inc.php


3. Insert into content.func.inc.php


// Determine position of content parts
$content["all"] = str_replace('{FIELD1}', $content["pos1"], $content["all"]);
$content["all"] = str_replace('{FIELD2}', $content["pos2"], $content["all"]);
$content["all"] = str_replace('{FIELD3}', $content["pos3"], $content["all"]);
$content["all"] = str_replace('{FIELD4}', $content["pos4"], $content["all"]);
$content["all"] = str_replace('{FIELD5}', $content["pos5"], $content["all"]);


{FIELD1/2/3/4/5} determines where pos1, pos2, pos3, pos4, pos5, will be show on the

page. Example: by adding {FIELD1} to header, the articles content part defined as pos1

(that's the first radiobutton) will be shown in the header. Remember that you can use any layout, the original phpwcms-layout our your own layout/template


************
P.S. These are my own modifications and might not work with any future release of phpwcms!
the most of the phpwcms users work with the "oliver gerogi" layout. so you have the right often free. and when you create an hidden structure with an alias it's simple. you can make a lot with this like an phpwcms based blog on the home-page or in different sections of your site you can add short news for the section where you been.
and not only the {NEWS:x} tag where you see that somewhere in the hole site is an new article. or you can dd little instructions for the sektion you be.

also i need to say that i can't imagine your content tag!

Posted: Fri 27. Feb 2004, 19:59
by Pappnase
Spirou wrote:P.S. These are my own modifications and might not work with any future realease of phpwcms!
thats why i wrote this.
Pappnase wrote:but if this will work and oliver will release it in a new phpwcms release i will test it!*smile*

Posted: Tue 2. Mar 2004, 00:54
by cmslover
Spirou wrote:
I have mailed files and instructions to ionrock's phpwmcs development site. The URL is http://ionrock.umemusic.com/index.php?develphpwcms



2. Replace files:

act_articlecontent.php
content.article.inc.php
article.editcontent.inc.php
article.edit.tmpl.php
article.readform.inc.php


3. Insert into content.func.inc.php
Hi Spirou,

I downloaded the file and in README the file names to be replaced with the ACTUAL 5 files you included there are four NOT MATCH :

INLUDED FILE
content.func.inc
articlecontent.edit.tmpl

IN README
article.edit.tmpl.php
article.editcontent.inc.php


I'm confusing. Could you check it out?
Thanks very much!

Solved: Content part-tag

Posted: Tue 2. Mar 2004, 11:29
by Spirou
Hi CMSlover!

I have posted a new set of files to Ionrock's phpwcms development site. You should find only four files in the new zip. Some users might have experienced other problems since I noticed I had left my own path-settings in act_articlecontent.php. I've set these paths back to Olivers original version in the new hack.

Let me know if you have any further problems!

Spirou

file not found

Posted: Wed 3. Mar 2004, 05:36
by cmslover
Hi Spirou,

I downloaded the new file and when I hit the button " CREAT CONTENT", I got error " Not Found
The requested URL /house/include/inc_tmpl/phpwcms.php was not found on this server."

I installed PHPWCMS at directory "house".

Thanks for your help!

Edit: I fixed the path and don't have the error above, however, I still have problem.

1/Question: The 5 radio buttons can be seen only after an article was created and clicking on "Add content" button, is it correct?

2/ After adding more content type to the article, click on one 0f those buttons at the bottom 1=header, 2=main, 3=footer, 4=left, 5=right . It means if I want THIS PART of The ADDED CONTENT(TYPE) to show at the PAGE 's header, I should click on button 1, is it correct?

===> If the answer is Yes then why nothing is shown up at the header (yes Visible ON )

3/THEN, I go to TEMPLATE, add {FIELD1} into HEADER , but again, nothing showed up .

No matter what method I did, those ADDED CONTENT ( TYPE ) ALWAYS show at the BOTTOM of the MAIN TEMPLATE


Please tell me what is wrong?

Many thanks

Posted: Wed 3. Mar 2004, 13:45
by Spirou
Hi CMSlover!

1.
Question: The 5 radio buttons can be seen only after an article was created and clicking on "Add content" button, is it correct?
Answer: This is correct. Content positioning is not intended for articles but for content-parts. This means that no content will be shown without an article. :wink:

2.
Question: After adding more content type to the article, click on one 0f those buttons at the bottom 1=header, 2=main, 3=footer, 4=left, 5=right . It means if I want THIS PART of The ADDED CONTENT(TYPE) to show at the PAGE 's header, I should click on button 1, is it correct?
Answer: The first radiobutton is checked by default. Do not think of the numbers as 1=header, 2=main... If you choose radiobutton nr.2 then the content will go be published where {FIELD2} is inserted in the template, not everyone uses the standard template/layout that comes with phpwcms so i don't want to make it confusing by saying that radiobutton 1 = header

3.
THEN, I go to TEMPLATE, add {FIELD1} into HEADER , but again, nothing showed up .
Answer/Question: Did you get an empty header or did it read {FIELD1} in header? What kind of content-part did you try to add? Ie. media is not supported so if you try to insert a real-player file with {FIELD12345}with my script it will not work. Try to insert a bullet list, link list or any other "text based" content. Also check that you added the replacement-tags in content.func.inc.php.

Check the database: is any new records added to acontent_position?

Posted: Fri 5. Mar 2004, 08:14
by cmslover
Hi Spirou,

I finally managed to make your hack to work :) , not quite perfectly but the field does show on my index page now. ( i had to make the field12345 size fit to the template size. if template size is smaller, code won't show )

I have some questions for you, please help!

1/Here is what I did: STEP 1
a. create/choose a simple pagelayout 1 with left, right, top, bottom.
b. create template 1 and fill in simple replacement tages..Save templ
c. create category 1 article 1, add content 1 to it, check pos1
d. go back to template 1, add {FIELD1} to RIGHT
====>. Result: OK, pos1 shows on category 1 index/home page

2/STEP 2:
c. create category 2 article 2, add content 2 to it, check pos2
d. go back to template 1, add {FIELD2} to RIGHT or HEADER
=====> Result: pos2 does NOT show on category 2's article 2's page

Question:
-each article has maximum only 5 pos?
-pos can be placed anywhere WITHIN the article PAGE which THEY BELONG TO ?

- pos which added and BELONG to article 1 CAN NOT be displayed on article 2,3,...'s page? Even though they are using the same template and page layout. ( this happened in my case )

-If I have Category 1 with article 1 has content 1 checked as {FIELD5}
and article 2 has content 2 checked as {FIELD5} , in template RIGHT SITE I would input {FIELD5} ( for content 1) and in FOOTER I put another {FIELD5} ( for content 2) , what would happen? Will it know that they are two different contents even they are the same name?

-I want to place some content {FIELDX] on the TOP, RIGHT and FOOTER that will be dis played and remained though out the WHOLE SITE/ ALL PAGES, not just index page, can it be done with your hack?


Thanks much!