15 replies [Last post]
tjroberts086
tjroberts086's picture
Offline
Enthusiast
Last seen: 5 years 9 weeks ago
Timezone: GMT-5
Joined: 2010-01-08
Posts: 138
Points: 177

I've seen a lot of templates that use shortcodes.. Can anyone find me information on how to create them with a XHTML based layout (no CMS). Every search I do only shows how to create them in wordpress..

Tags:
Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 8 weeks 3 days ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2043
Points: 2268

What is "shortcodes"? Is it

What is "shortcodes"? Is it like BBcode?

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 31 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

It's a WP function to

It's a WP function to translate user entered data via a function into displayed content, used in posts or pages.

<WP content editor>
 
[Verschwindende type="guru_.net_programmer" title="Elder" anyvalueYouLike=""]
Say lots of stuff here if you choose to write the shortcode with $content function or leave out closing bracket and declare $content = null in function
[/Verschwindende]
 
</end WP content editor>

function Verschwindende($atts, content = null){
  extract(shortcode_atts(array(
  "title" => '',
  "type" => 'Developer'
  ), $atts));
?>
<h1><?php echo $title; ?><h2>
return;
}
add_shortcode('Verschwindende', 'Verschwindende');

@tjroberts086 they are a WP custom function but are not a new concept as Versh mentions BBcode is a variation of the principle of allowing users to add or manipulate content in an easy to remember / use method with the hard work of translating and processing done behind the scenes, writing one similar to WP couls be done by reverse engineering the WP function i.e tracking back through the functions used to see how they did it.

As this is not a CSS question I'm moving it from 'CSS Styling' to 'Off Topic'

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

tjroberts086
tjroberts086's picture
Offline
Enthusiast
Last seen: 5 years 9 weeks ago
Timezone: GMT-5
Joined: 2010-01-08
Posts: 138
Points: 177

Wordpress currently scares

Wordpress currently scares the *beep* out of me. I wanted to release a template as XHTML but with shortcodes, until I get Wordpress mastered. Will look into this, if anyone finds information please post here. thank you Hugo, and everyone else.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 31 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

WP is not difficult, a tad

WP is not difficult, a tad frustrating at times but in the main it's fairly straightforward and nowadays with a much better codex you will find most things documented with examples of how to use.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 15 hours 15 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9761
Points: 3843

And then there are the themes

As a frontend guy, the largest WP pita for me results from the theme writers, especially those who think grid systems are the highest state of the art. A pox on all soi-disant designers with little understanding of best practice separation of structure, presentation, and behavior. Aside from the complete lack of semantic value in id and class tokens, these grid systems effectively intermingle structure and presentation as badly as table layouts ever did.

Whoo! </rant>

Now, what were we talking about? Shortcodes? Oh, I don't know anything about them. Never mind.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

tjroberts086
tjroberts086's picture
Offline
Enthusiast
Last seen: 5 years 9 weeks ago
Timezone: GMT-5
Joined: 2010-01-08
Posts: 138
Points: 177

im one of those 960 grid guys

im one of those 960 grid guys lol. I never heard anything bad about it.. Care to share? Laughing out loud
I recently was trying the new fluid 960 grid, being that mobile / responsive layouts seem to be the new thing. I just dont understand how you can use sliders and stuff like that with a responsive layout..

tjroberts086
tjroberts086's picture
Offline
Enthusiast
Last seen: 5 years 9 weeks ago
Timezone: GMT-5
Joined: 2010-01-08
Posts: 138
Points: 177

Hugo, would you please

Hugo, would you please recommend your favorite codex please?

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 8 weeks 3 days ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2043
Points: 2268

tjroberts086 wrote: Hugo,

tjroberts086 wrote:

Hugo, would you please recommend your favorite codex please?

I believe he was talking about the wordpress codex.

tjroberts086
tjroberts086's picture
Offline
Enthusiast
Last seen: 5 years 9 weeks ago
Timezone: GMT-5
Joined: 2010-01-08
Posts: 138
Points: 177

Oh wow I was thinking codex

Oh wow I was thinking codex ment some kind of extension for WP. Thanks everyone for all your help this WP stuff really isnt to bad with the right learning resources!

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 15 hours 15 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9761
Points: 3843

tjroberts086 wrote: im one of

tjroberts086 wrote:

im one of those 960 grid guys lol. I never heard anything bad about it.. Care to share? :-D[snip]

Start by telling me what contexts these classes describe:

.grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6, .grid_7, .grid_8, .grid_9, .grid_10, .grid_11, .grid_12, .grid_13, .grid_14, .grid_15, .grid_16 {
display : inline;
float : left;
position : relative;
margin-left : 10px;
margin-right : 10px;
}
.container_12 .grid_3, .container_16 .grid_4 {
width : 220px;
}
.container_12 .grid_6, .container_16 .grid_8 {
width : 460px;
}
.container_12 .grid_9, .container_16 .grid_12 {
width : 700px;
}
.container_12 .grid_12, .container_16 .grid_16 {
width : 940px;
} 
They don't. They describe a presentation property. These presentation based class tokens offer no way to zero in on a given element or element group without also affecting all other elements of the same class. The system intertwines presentation values into the structural/contextual markup. To change something, you must change the markup, and that is the kind of silliness that css is supposed to leave behind. The grid system is not a bad thing in itself, simply an extension of the printers paste up board to the web page, and that's just an extension of the graphic designers' not grokking web design.

Hell, I do grids myself to formalize whatever columnar relationships I've decided on. I am certainly not going to let some silly preset grid to do my thinking for me; besides, some of the more perfect proportions are based on irrational numbers.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 31 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

There is no way anyone who

There is no way anyone who has learnt the skills required to work with CSS and markup in a Semantic, Standards manner can handle the code Gary demonstrates above and remain sane and calm tempered - believe me. I have an inherited project I'm trying to make sense of and work with that is written to a devs imagined version of a grid system, all it manages to do is reign utter confusion and complexity on what is actually a simple set of layout elements occurring in varying degrees from page to page.

Please do not get too involved with grids and frameworks when frontend coding, nothing smacks more to me of a developer not qualified to be handling the sharp end of web site building than someone relying on grids and frameworks.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

tjroberts086
tjroberts086's picture
Offline
Enthusiast
Last seen: 5 years 9 weeks ago
Timezone: GMT-5
Joined: 2010-01-08
Posts: 138
Points: 177

I agree totally with you

I agree totally with you both. Thank you Gary & Hugo for your great post here, you both are a great inspiration.

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 15 hours 15 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9761
Points: 3843

tjroberts086 wrote: I agree

tjroberts086 wrote:

I agree totally with you both. Thank you Gary & Hugo for your great post here, you both are a great inspiration.

Aha! You're easily amused. Smile

As I reread Hugo's and my posts on the grid system, I realize we both made some absolute value judgements. While true, we are, perhaps, a bit harsh. In our defense, I offer that we have both gone through the IE wars and the goofiness that Dreamweaver produced when trying to use css. Neither of us has much patience for whatever the latest round of fatuousness is that will save the world of web design, especially one so fragile and restrictive as, for example, [pick a number]grid.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 8 weeks 3 days ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2043
Points: 2268

Hugo wrote: It's a WP

Hugo wrote:

It's a WP function to translate user entered data via a function into displayed content, used in posts or pages.

<WP content editor>
 
[Verschwindende type="guru_.net_programmer" title="Elder" anyvalueYouLike=""]
Say lots of stuff here if you choose to write the shortcode with $content function or leave out closing bracket and declare $content = null in function
[/Verschwindende]
 
</end WP content editor>

function Verschwindende($atts, content = null){
  extract(shortcode_atts(array(
  "title" => '',
  "type" => 'Developer'
  ), $atts));
?>
<h1><?php echo $title; ?><h2>
return;
}
add_shortcode('Verschwindende', 'Verschwindende');
...

How is that "short"? Tongue Seems like the long way to get nowhere fast. Wink

nightvisionsuk
nightvisionsuk's picture
Offline
newbie
http://www.nightvisiondirect.co.uk/night-vision-digital
Last seen: 8 years 15 weeks ago
http://www.nightvisiondirect.co.uk/night-vision-digital
Timezone: GMT+5.5
Joined: 2012-03-17
Posts: 1
Points: 1

Wordpress platforms currently

[snip - Automated or copy/paste fluff posts are not appreciated within these forums. Please take your efforts elsewhere. ~gt]