How to put line when td table value extend to another page TCPDF - tcpdf

Good day sir, Im a newbie programmer. I would like to know how to put a line if the td extend to another page? I attach the image what is my problem. Sorry if my english not fluent.

Related

Orchard CMS Recent Blog Post Widget Alternate View

I'm new to Orchard CMS and MVC so please forgive my ignorance. I've done a search and not found anything apparently relevant....
In one of the Footer Quad zone on my Orchard site I want to show the 5 most recent blog posts, just by title. At present it show the title, post, tags etc all in their unformatted state(Ive not style the blog yet).
Using the tracing tool I've created an alternate view called;
Parts.Blogs.RecentBlogPosts
However the only content in this view is;
#Display(Model.ContentItems)
Which -unlike other installed widgets Ive edited alternate views for- doesn't give me anything to play around with to create the layout I'm needing to create.
Have I selected the wrong shape / view, or do I need to get stuck in with some coding???
As I say, I'm new to both MVC and Orchard but very keen to learn. Any help on this will, as always, be greatly appreciated.
I got the exact same problem while trying to differentiate recent blog posts layout from blog summary posts. I followed this concept
http://weblogs.asp.net/bleroy/archive/2011/07/31/so-you-don-t-want-to-use-placement-info.aspx
and created Parts.Blogs.RecentBlogPosts alternate. Then while navigating through the model using shape tracing tool I found all elements I was looking for and put them in my new shape. I know that my approach might not be the most appropriate one but it works. Maybe it would be a starting point for someone who would need to do similar thing:
<div class="last-news">
<ul>
#foreach (var item in Model.ContentItems.ContentItems.Items)
{
var max = (item.ContentItem.BodyPart.Text.Length > 100) ? 100 : item.ContentItem.BodyPart.Text.Length;
<li><header>#Display(item.ContentItem.CommonPart.PublishedUtc.ToShortDateString())</header></li>
<li><h1>#Display(item.ContentItem.TitlePart.Title)</h1></li>
<li>#Display(Html.Raw(item.ContentItem.BodyPart.Text.Substring(0, max)))</li>
}
</ul>
</div>
It does deserve an explanation. Model.ContentItems here really is a List shape. When you call Display with it, it will locate the most appropriate template for a list shape (and that can be an alternate) and renders it. The default List rendering just renders UL/LI and in each LI calls Display on the individual Content shape for the list element, but with the Summary display type. When that in turn gets rendered, the system locates the most relevant Content template, which usually renders a bunch of zones, inside of which the parts get pushed according to placement. So there is a lot going on, in quite a few nested levels.
Still, it is possible to override the whole thing at any level. The difficulty is to know what to put there. The easiest for this is to explore the Model in shape tracing and see what you can use.
This article shows how to override list rendering in a particular situation and take it over entirely:
http://weblogs.asp.net/bleroy/archive/2011/03/27/taking-over-list-rendering-in-orchard.aspx
The Parts.Blogs.RecentBlogPosts view displays Parts_Blogs_BlogPost_List shape (Parts.Blogs.BlogPost.List.cshtml) which displays BlogPost content items. (You can see it in RecentBlogPostsPartDriver.cs). BlogPost content type consists of TitlePart and BodyPart parts which has their own shapes and views (or templates in Orchard terminology).
So to make some corrections for those templates you could try to alternate Parts_Blogs_BlogPost_List, Parts_Common_Body_Summary and other shapes.
Please see the following instructions on Orchard docs page especially:
Alternates
Accessing and Rendering Shapes

How to add a title to your Lightbox (v.2.5)

This is not a Question, just some advise I want to give to you.
After hours of googling and testing out, I didn't find a solution that worked on my lightbox. I don't know why, but I just couldn't apply a link into the title, not with htmlentities() etc.
So I came up with my own solution, which is just a workaround.
I'm not really satisfied with myself but it's the only way it works for me.
So, if you're having the same troubles like me, just add this line of code:
Search for this line of Code in lightbox.js (In my file it was the line 277):
$lightbox.find('.lb-caption').html(this.album[this.currentImageIndex].title).fadeIn('fast');
and replace it with this:
$lightbox.find('.lb-caption').html('<span onclick="window.location.href=\'http://yourdomain.com\'">'+this.album[this.currentImageIndex].title+"</span>").fadeIn('fast');
What did I do?
Since .lb-caption is added to display the title attribute, i just wrap the original output in an element and bind a click event to a certain location.
Problem with it:
Since I wrapped around the whole title attribute, the whole title attribute becomes a link.
To get the cursor: pointer; effect in css and your standard link layout, just make the title a link. In this way it doesnt has to be htmlentities() decoded link.
Example:
This link opens a new page
Another problem is: Now is the link static. (Since we're not using the href of our link).
Solution:
To add One $_GET Attribute to the link, we just need to fix a few lines.
What you do is, in your image call (the part) you add the attribute "rev", means:
Instead of This link opens a new page,
you now use (add the "rev" attribute"):
This link opens a new page
Now to the Javascript part...
Search for:
if ($link.attr('rel') === 'lightbox') {
this.album.push({
this part, and replace:
link: $link.attr('href'),
title: $link.attr('title'),
with
link: $link.attr('href'),
title: $link.attr('title'),
rev: $link.attr('rev')
If you go a few lines down you'll see the same part with link: $…., title: $…., replace that part with:
link: $(a).attr('href'),
title: $(a).attr('title'),
rev: $(a).attr('rev')
Now we just need to modify our wrapper: (Go back to now line 279, before the $_GET part it was line 277)
$lightbox.find('.lb-caption').html('<span onclick="window.location.href=\'http://yourdomain.comindex.php?page=contact&t='+this.album[this.currentImageIndex].rev+'\'">'+this.album[this.currentImageIndex].title+"</span>").fadeIn('fast');
We add now '+this.album[this.currentImageIndex].rev+' instead of the static part.
You can repeat this method to add infinite $_GET parameters, just add a new attribute to your image call, and change the javascript like we did in my explanation.
This is a really complicated and unusual way to solve the link in title problem, but its the only way how it will work in my script.
I hope that I helped someone! :)

Why does the simple_format helper seem to ignore double new lines in ruby on rails?

I have a micropost feature and was testing the way it formats text that has been posted when displaying back to the user.
I pasted the following text like this:
and this was displayed back to me:
I'm using "simple_format h(content)". When I remove the helper the text is displayed with out a new line from the word "In". It displays as one big paragraph so I assume the helper is working but for some reason my double new lines are being ignored.
Any idea what is going on? Am I missing something?
By seeing it back, do you mean inside a textarea, or on the page? If it's on the page, all whitespace is compressed to one space each. If it's the latter, simply use the css rule:
white-space:pre;
On the proper selector.
However, if it is in a textarea (which preserves whitespace by default), there must be something stripping the extra space when you save it into the database. You might want to debug down your stack in the model & controller, to see where this might be happening. I have to admit i haven't used the the simple_format method.
Thanks to chrome developer tools as per usual. I realised that each text separated by 2 new lines were wrapped with p tags so I just added a bottom margin of 5px using css to p. Works perfectly.

How do I remove HTML tags from within a text area using MVC 3?

I have difficulty getting a value from a text area of the CKEditor
when I save something that has nothing inside the textarea HTML tag. In this case, it puts this text inside:
<html>\r\n\t<head>\r\n\t\t<title></title>\r\n\t</head>\r\n\t<body>\r\n\t</body>\r\n</html>\r\n"
Is there some way to strip off all these html tags?
I'm using MVC 3, and I've researched something about: Content(Server.HtmlEncode),
but I'm still not 100% if this is the best way to do this kind of treatment.
I found a class listed below that looks like it should solve your problem. Just add it to your solution and you can then call it statically and strip the html.
This kind of assumes that you are wanting to do the stripping of html on the server side.
On a side note not accepting answers like you are doing is hazardous to people willingness to help...I'd recommend that you reward the people that are helping you if you'd like to continue getting help!
Link to Solution
#Html.DisplayTextFor(modelItem => item.content)

trouble using tinymce using ruby on rails

I am having trouble in using tinymce editor with rails 3. I want to show text in bold letters and having trouble using tags like when I write something in p tags It should go to next paragraphs. in my case this tags is not working. It remains on same lines and display p tags on site page.
The usual suspect when it comes to rails 3 printing raw html output to the site, is that someone forgot to call html_safe on whatever text should be printed.
So if you have a #my_model_instance.description that you edit with tinymce, you might want to make the view look like #my_model_instance.description.html_safe, or as they suggest in the comment on the documentation, raw(#my_model_instance.description).
If the text is coming from user input, however, you might want to be a bit cautious, since it might be possible for users to input all sorts of nasty injection hacks this way.

Resources