named anchor? link content of different blocks?

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
TI&OSM
Posts: 37
Joined: Tue 27. Feb 2007, 09:30
Location: The Hague, The Netherlands

named anchor? link content of different blocks?

Post by TI&OSM »

How do I make 'named anchor'?

For instance I have my search form in the {HEADER},
but I want my search results to be shown in {CONTENT}?

And can I only use {HEADER}, {CONTENT}, {FOOTER}, {RIGHT} and {LEFT} or are there more than 5 block you can define?

Robert [TI&OSM]
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Post by update »

there is the possibility to create so called "custom blocks" in admin/page layout: custom:blocks. Just have a look and put in some BLOCK1, BLOCK2....
Then you will have these in your admin/templates section. Now insert {BLOCK1}... into your template....
This should work

claus
TI&OSM
Posts: 37
Joined: Tue 27. Feb 2007, 09:30
Location: The Hague, The Netherlands

Post by TI&OSM »

Thanks Claus, I like it when things are easy…!

Do you also have the answer on my other question…
How do I make 'named anchor'?

For instance I have my search form in the {HEADER},
but I want my search results to be shown in {CONTENT}?
It would be really nice, because it makes phpwcms a lot more flexible.

Thanks on forehand,

Robert [TI&OSM]
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Post by Jensensen »

Hi,

seems to be two questions. Regarding 'anchors' more information might follow...

For search forms you don't need anchors.

1) Make a new article with contenpart 'search form'
this will be even the page where all the results are listed.
so you rather place it in {CONTENT} or some of your main blocks.

2) check source code of page and copy the form code snippet.

3) paste the snippet to your templates where ever you want.

source code looks like
<form name="search" id="search" action="LINK_TO_YOUR_SEARCH_PAGE (step 1)*" method="post">
<input type="text" name="search_input_field" id="search_input_field" value="Search" />
</form>
*index.php?id=0,12,0,0,1,0 or something...

search_input_field don't change the input variables!!!

groetjes n greetz
Last edited by Jensensen on Thu 2. Oct 2008, 22:00, edited 1 time in total.
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
TI&OSM
Posts: 37
Joined: Tue 27. Feb 2007, 09:30
Location: The Hague, The Netherlands

Post by TI&OSM »

Hello Jensensen,

Thanks for your input, it works great! Many thanks…

Yet, another question…

The search results do not have a empty line between them.
The come in a 'div', but I don't know where I can define that 'div'.
It's not the 'search_results div', it's nested in that one.

Further you can 'mark' the word you are looking after,
it is defined standard with 'em' and you can add other definitions to it,
but you can't get rid of the 'em' and that's what I do want!

Can you Jensensen or anybody help me with this?

Many thanks in advance,

Robert [TI&OSM]
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Post by Jensensen »

Hi Robert,

to modify this special <div>-tag you will need to patch some file!! so be careful, even when updating to newer versions!!!

open [v.1.3.3]:
/include/inc_front/content/cnt13.article.inc.php

line 268

Code: Select all

$s_result_list .= '<div>'.LF;
and add a CSS class e.g.
$s_result_list .= '<div class="MySpecialResultClass">'.LF;

btw, its worth to have a look for the following lines, too.

don't forget to add this class in your frontend.css!

this is, you should do to modify the <em> tag within your search results --->

.phpwcmsSearchResult em.highlight, em.highlight {
background-color: #FFFF00;
font-style:inherit;
}


remember that <em>, like <strong>, <h1> for example, is one of the most "preferred" spidering index tag for google and others. :wink:

greetz
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
TI&OSM
Posts: 37
Joined: Tue 27. Feb 2007, 09:30
Location: The Hague, The Netherlands

Post by TI&OSM »

Hello 'Jensensen',

Many, many thanks…!

I always wonder, how do people like you know these kind of things?!?!
Anyway, I'm glad there are people like you.

So, if I understand it well, I can change other things in all the other 'cnt**.article.inc.php', that means when I'm ready for it, technically speaking.

Many thanks again, Robert
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Post by Jensensen »

TI&OSM wrote:...So, if I understand it well, I can change other things in all the other 'cnt**.article.inc.php', that means when I'm ready for it, technically speaking...
Hi Robert,
well, indeed, yes you can, but you should better DO NOT TOUCH these files, as they are the "heart" of "our" numerously well-loved phpwcms. USUALLY there is even NO NEED to change this files. Also to do patches that way will result in MUCH MORE DIFFICULTIES, when doing updates and may run into profoundly malfunctions!!!

Otherwise it IS really worth to have a closer look to this files and somehow exciting to me. As I mentioned, this are the major program files with all the routines and stuff like that. So reading code means to learn, how the things work together hand in hand and what happens in the background. In short: to know better how phpwcms is working --> to get creativity out of the brain straight to backend and then, finally, most impressively presented in front to the public.

Greetz and happy coding
Last edited by Jensensen on Tue 22. May 2007, 00:49, edited 1 time in total.
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

you can do it without 'hacking' the Code by wrapping it into a Div-Container by this way

make a Contentpart HTML before and after the Contentpart Search

in CP before insert <div class="yourClass">
and in CP after just </div>

so in end you have 3 CP's in the Article

HTML
SEARCH
HTML
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Post by Jensensen »

as you all can see, sometimes the things are much easier! :wink:
a little bit more effort is necessary to edit pages but a very elegant solution, pico, i didn't think about :shock:

but you will have to keep CPs in order carefully!!!!

can be very helpful i guess.
but wait, doing it this way, you have NO possibility to adjust distances (margin, padding) BETWEEN search results, isn't it?
TI&OSM wrote:Yet, another question…

The search results do not have a empty line between them.
The come in a 'div', but I don't know where I can define that 'div'.
It's not the 'search_results div', it's nested in that one.
greetz
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

by a little thinking and knowing how Cascading-Style-Sheets are working this is possible too

you can define Classes for every Tag in a Container

as Example

you have wrapped the Search CP into a Class named 'mySearch'
so when you take a look to the generated HTML-Sourcecode you will find something like this

Code: Select all

<div class="mySearch">
<div>
<h3><a href="index.php?id=100,53,0,0,1,0&highlight=test">Tool Tip</a></h3>
<p>and Info Pop-Up This is a short Sample how Tooltip works. - in AdminSection goto 'Keyword' and enter your Keywords for a Glossary - create a hidden Si<em class="highlight">test</em>ructure you call Keyword (for example) and with…</p>
</div>
</div>
so you can build Classes like:

.mySearch p{
font-size:18px;
background:#edcaef;
}
.mySearch a{
font-size:12px;
background:#00ff00;
}
.mySearch a:hover{
....
}


think about Parents and Childs ;)
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Post by Jensensen »

Hi pico,
you're RIGHT!
Thanks!

So, always check output, code first - then adjust CSS.

Additionally, to solve Rob's prob in this case, you can CSS the following:

.mySearch div {
padding-bottom: XYpx;
margin: Xpx 0 Yem 0;
}

.mySearch h3 {
your: style;
}

.mySearch h3 a {
your: style;
}

.mySearch h3 a:hover {
your: style;
}

.mySearch p {
your: style;
}

.mySearch p em {
your: style;
}

.mySearch p em.higlight {
your: style;
}

greetz
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
TI&OSM
Posts: 37
Joined: Tue 27. Feb 2007, 09:30
Location: The Hague, The Netherlands

Post by TI&OSM »

Jensensen and Pico,

Many thanks for your contribution!!!!!
I really appreciate it and it brings me a step forward
in freedom of designing with phpwcms.

Robert [TI&OSM]
powlido
Posts: 29
Joined: Mon 14. Jan 2008, 12:59

Re: named anchor? link content of different blocks?

Post by powlido »

Hi Jensensen,

Thanks for this piece... however I am having a little trouble using.

I appear to have it set up ok but my results appear with another search box above.

How do get rid of that? - I am using a 'search' content part in my article - should I use something another CP?

many thanks,

paul
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: named anchor? link content of different blocks?

Post by Jensensen »

depends on what you want? don't know, can't see...

Think about your templates to use it (whenever possible!) with a certain CP. Add/edit your HTML and then add CSS as needed.
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
Post Reply