How to add page number qweb odoo without div class header and footer - odoo

I would like create report in odoo but the page information not in header or footer. I'm using <span class="page"/> of <span class="topage"/>. It's work if that code inside <div class="header"/> or <div class="footer"/>. But I get tricky case, that is page number must show in table or anywhere except footer or header. Anyone can help me please?

Accessing the current page (page) and the number of pages (topage) outside of headers and footers is not yet available.
As commented by the wkhtmltopdf maintainer on june 2020
Although this is obviously good to have, I'm not sure how it can be implemented right now -- the focus right now is upgrading the browser engine (read the project status), this will come after/if it gets upgraded.
The feature will come after upgrading the engine browser
You can see that feature requests like global variable for page number are still open

Related

Caching Issue with App Within Minutes sheet pages

I have created simple AppWithinMinutes application and I added following velocity code at the end in “sheet” page just before the html tag ends:
<div>
#set ($title = $doc.title)
## OR #set ($title = $doc.name), depending if your pages have titles
#set ($newTitle = $title.substring(0,6) + "X" + $title.substring(7, $title.length()))
<h2>Applications with a tag: $newTitle</h2>
{{PagesByTag tagName=$newTitle}}{{/PagesByTag}}
</div>
PagesByTag is a macro that I created to list all pages that contains the tag of a new title that I calculated.
Problem is:
I have a page called “My Application” with a tag “SERVERX01”
I have created a page in my AppWithinMinutes called “SERVERD01”. So now when I visit page SERVERD01, it displays “My Application” and that is desirable behavior (when you hard refresh it, disappears… hard refresh again brings it back… So it seems to be a cache issue…)
Now when I create a page in AppWithinMinutes called “MYAAPPD21”. Now “My Application” shows up here as well… This is not expected since $newTitle now will be “MYAAPPX21” and there is no page with that tag… (Hard refresh to that page will make “My Application” disappear but now when I visit “SERVERD01” page, “My Application” is gone from there as well)
There seems to be a serious caching issue with “sheet” page. Can someone tell me how can I disable caching for AppWithinMinutes display (sheet) pages?
Thanks a lot
I found a solution. In case someone like me facing exact same issue.
There wasn't an issue with App Within Minutes. It was a macro I created PagesByTag It has cached property set to yes. That was causing tag result on the sheet page to cache and was displaying undesirable results.

SharePoint 2010 Site Customization: Removed breadcrumb and now receiving errors

I removed the following fields from the "s4-titletext" cell using the Manage Content Regions in SPD:
PlaceHolderSiteName
PlaceHolderPageTitleInTitleArea
PlaceHolderPageDescription
And I added "SharePoint:SPLinkButton... Visible="False"
I have published this template and have set it as the Default Master. It displays fine but when I add a web part (not in SPD), I get the error "You must specify a value for this required field" and it will not let me add/remove the web part or change any list. What did I do wrong in my customization? I followed the instructions on this post. I used Option 2 to hide the words. The reason I removed the fields is because I want to stretch our banner across the whole page and I didn't want to leave the space where the bread crumb would have been. My "s4-titletext" area looks like the pictures on the top of the page, only banner is stretched all across the top of page. I can not add a link to my page due to it being on a private server. I have asked other SharePoint experts and they are stumped as well. Thank you for your help on this.
Instead of setting visible="false", getting hiding the control using a CSS class. Set the control's class to something like 'hiddenClass' and then define your class style.
.hiddenClass{display: none;}
Customizing SharePoint masterpages is a pain since they're so sensitive. You have to use this method when hiding a lot of the out of the box controls.
Some placeholders need to be on the master page, if you remove it it will cause errors in some of the scrips.
What I recommend to you is create a hidden div and inside of it put all the placeholder you want to hide, like the example bellow.
<div style="display:none">
<asp:ContentPlaceHolder ID="TitleZone" runat="server"></asp:ContentPlaceHolder>
<div>

How to get URL after javascript.page.open

I have an ASP page (I did not write it and cannot change it) that calls an ASPX page written in VB.NET (I can change it)
Here is code from the ASP page:
<A style="CURSOR: pointer" title="View document" onclick="javascript:window.open('https://MYSERVER/MYPAGE.aspx?param=0123456789', 'popup');">View </A>
So, it pops the page with a parameter, but in order to do something, MYPAGE must know what URL the request came from. Now the problem is Request.UrlReferrer is NULL.
how do I find out which URL the request came from?
Thank you
EDIT: Just making sure everyone understands - I CANNOT change the ASP page. It remains the same opening a new window calling the 2nd page with onclick="javascript:window.open('https://MYSERVER/MYPAGE.aspx?param=0123456789'. The ONLY page I can change is the 2nd page, the one that got called.
You cannot rely on UrlReferrer since it is obtained from a header field that the browser should send, but does not in a number of cases.
The safest and best option is to get the ASP page to provide a param in the URL to identify the requestor.
If you cannot do this, another potential option is to leave the current page in place for the ASP page and create a new page for all other requests that route to the old page with an appropriate parameter to identify the source of the traffic (or vice versa).

adding "last edit time" to trac wiki pages

My organization has a sprawling wiki that isn't kept up to date very well. To reduce the danger of new people reading a page and not realizing how outdated it is, I'd like to modify the page header so that instead of
Page Name
at the top, it says something like
Page Name - last modified 5/8/10 by Joe
I see that Trac allows page templates, but if we haven't used those before, is there a 'blank' template I could alter to change all existing pages?
Unless you have changed something, Trac wiki pages should have a "Last Modified" entry in the top right-hand corner of each page. Hovering the mouse over different parts of the text will show you more details, like the user name of the last person to edit the page and a detailed timestamp of when the last edit was made. Is this different from the functionality that you are asking about?
You can put the following in site.html in the templates directory of your project directory:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:py="http://genshi.edgewall.org/"
py:strip="">
<!--!
This file allows customizing the appearance of the Trac installation.
Add your customizations here and rename the file to site.html. Note that
it will take precedence over a global site.html placed in the directory
specified by [inherit] templates_dir.
More information about site appearance customization can be found here:
http://trac.edgewall.org/wiki/TracInterfaceCustomization#SiteAppearance
-->
<div py:match="div[#id='wikipage']" py:attrs="select('#*')" once="true">
<h1>Last modified ${format_date(page.time)} by ${authorinfo(page.author)}</h1>
${select('*|text()|comment()')}
</div>
</html>
It doesn't add the last modified info into the title, but displays it before rendering the rest of the page. I don't think you can add it to the title without changing the code of how wiki formatting is rendered.
If you want the last modified date to be more visible, you can use the LastModifiedMacro. I'm fairly sure you could insert it into all existing pages with a simple script that read/writes to wiki table in the database, but I've never done anything like that myself. Take a look at the Database Schema, though keep in mind there may be a better way to do this through the Trac API.

Keeping DRY with progressive enhancement

I'm building a website with very small amounts of Javascript, just to add things to the page (like a contact form) without having to go to a new page.
I understand that I should build the contact page anyways (just in case the user doesn't have javascript turned on) and then use javascript if they've got it.
So where do I store the HTML for the form if I don't want to have it in two places?
(Normally I'm not so picky, but I'm curious on this one.)
If you have access to a server-side language, you can keep a separate snippet of the form in an external page. Then, you can include the snippet into the HTML content page with an appropriate include call. This has the added benefit that, for your JavaScript, you can pull the contact form from this snippet file using AJAX. In fact, many plugins allow you to display DHTML windows with HTML content. For example, check out ThickBox.
Without a server-side language, you can do something similar with frames. Just display the form snippet in a frame when you need to reference it. Personally, I don't like frames very much, so this isn't a very attractive solution for me, but you can use it if you choose (and style the frames appropriately).
Just put your HTML for the contact form in a .html file. Assuming you're using PHP or something, just include the file in your contact page and include it in the section for your dynamic contact form. The form should still submit to the same server-side page and have the same look and feel..
e.g. contactForm.html
<div class="contact-form">
<input ....>
</div>